-
-
Notifications
You must be signed in to change notification settings - Fork 576
fix: handle lazy connection type #3941
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
fix: handle lazy connection type #3941
Conversation
Reviewer's GuideThis PR updates Relay field handling to resolve lazy connection types before type checks and adds a corresponding test to ensure optional lazy connections work as expected. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @rcybulski1122012 - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Fixes handling of lazy connection types in the ConnectionExtension class, ensuring proper resolution of types specified via graphql_type argument in Relay connections.
- Added LazyType resolution handling in
strawberry/relay/fields.py
for ConnectionExtension class - Added test case
test_lazy_optional_connection
intests/relay/test_connection.py
to verify proper lazy type resolution - Important fix for scenarios involving circular imports where lazy loading is necessary
2 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3941 +/- ##
==========================================
- Coverage 94.75% 94.75% -0.01%
==========================================
Files 520 520
Lines 33902 33934 +32
Branches 1754 1756 +2
==========================================
+ Hits 32123 32153 +30
- Misses 1497 1498 +1
- Partials 282 283 +1 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #3941 will not alter performanceComparing Summary
|
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ty for this 😊
Thanks for contributing to Strawberry! 🎉 You've been invited to join You can also request a free sticker by filling this form: https://forms.gle/dmnfQUPoY5gZbVT67 And don't forget to join our discord server: https://strawberry.rocks/discord 🔥 |
Fixes
ConnectionExtension
, so if a lazy connection type is specified viagraphql_type
argument, it is resolved.Types of Changes
Issues Fixed or Closed by This PR
Checklist
Summary by Sourcery
Resolve lazy connection types in Strawberry Relay to correctly handle connections specified via lazy annotations.
Bug Fixes:
Tests: