Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nullable Connection types in relay field decorator #3706

Closed
wants to merge 2 commits into from

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Nov 20, 2024

Resolves #3703

Enable nullable Connection types in the connection field decorator by updating type checking logic and adding validation for inner types. Update documentation and add tests to ensure compatibility with permission extensions and different nullable syntax.

New Features:

  • Support nullable Connection types in the connection field decorator in strawberry.relay.fields.

Enhancements:

  • Update type checking logic to handle Optional[Connection[T]] and Connection[T] | None annotations.

Documentation:

  • Update documentation to reflect that connection fields can now be nullable.

Tests:

  • Add tests to verify nullable connection fields work correctly with permission extensions and both Optional[Connection[T]] and Connection[T] | None syntax.

This PR was automatically generated.

If you want to make changes to this PR:

  • Leave a review and I'll make the changes
  • Leave a comment with the changes you want to see
  • Push commits to the branch

Enable nullable Connection types in the connection field decorator by updating type checking logic and adding validation for inner types. Update documentation and add tests to ensure compatibility with permission extensions and different nullable syntax.

New Features:
- Support nullable Connection types in the connection field decorator in strawberry.relay.fields.

Enhancements:
- Update type checking logic to handle Optional[Connection[T]] and Connection[T] | None annotations.

Documentation:
- Update documentation to reflect that connection fields can now be nullable.

Tests:
- Add tests to verify nullable connection fields work correctly with permission extensions and both Optional[Connection[T]] and Connection[T] | None syntax.

Resolves #3703
@sourcery-ai sourcery-ai bot requested a review from patrick91 November 20, 2024 12:10
@botberry
Copy link
Member

botberry commented Nov 20, 2024

Hi, thanks for contributing to Strawberry 🍓!

We noticed that this PR is missing a RELEASE.md file. We use that to automatically do releases here on GitHub and, most importantly, to PyPI!

So as soon as this PR is merged, a release will be made 🚀.

Here's an example of RELEASE.md:

Release type: patch

Description of the changes, ideally with some examples, if adding a new feature.

Release type can be one of patch, minor or major. We use semver, so make sure to pick the appropriate type. If in doubt feel free to ask :)

Here's the tweet text:

🆕 Release (next) is out! Thanks to sourcery-ai[bot] for the PR 👏

Get it here 👉 https://strawberry.rocks/release/(next)

Copy link
Member

@patrick91 patrick91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left a comment regarding UnionType

@@ -23,6 +23,7 @@
Tuple,
Type,
Union,
UnionType,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnionType should be imported from types, but it is only available on python 3.10+

see is_union in strawberry/utils/typing.py

@patrick91
Copy link
Member

This is a bit more complicate than expected, so I'll make a new PR :)

@patrick91 patrick91 closed this Nov 20, 2024
@patrick91 patrick91 deleted the sourcery-ai/issue-3703 branch November 20, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for nullable Connection
2 participants