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

fix: Fix lazy aliased connections type resolution #3524

Merged
merged 5 commits into from
May 28, 2024
Merged

Conversation

bellini666
Copy link
Member

No description provided.

@bellini666 bellini666 self-assigned this May 28, 2024
@bellini666 bellini666 requested a review from patrick91 May 28, 2024 21:05
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @bellini666 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟡 Testing: 3 issues found
  • 🟡 Complexity: 1 issue found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

strawberry/utils/typing.py Show resolved Hide resolved
strawberry/utils/typing.py Show resolved Hide resolved
strawberry/relay/fields.py Show resolved Hide resolved
tests/types/test_lazy_types.py Show resolved Hide resolved
tests/types/test_lazy_types.py Show resolved Hide resolved
tests/relay/schema.py Show resolved Hide resolved
strawberry/relay/fields.py Show resolved Hide resolved
@botberry
Copy link
Member

botberry commented May 28, 2024

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:


This release fixes an issue that would prevent using lazy aliased connections to
annotate a connection field.

For example, this should now work correctly:

# types.py


@strawberry.type
class Fruit: ...


FruitConnection: TypeAlias = ListConnection[Fruit]
# schema.py


@strawberry.type
class Query:
    fruits: Annotated["FruitConnection", strawberry.lazy("types")] = (
        strawberry.connection()
    )

Here's the tweet text:

🆕 Release (next) is out! Thanks to @_bellini666 for the PR 👏

This release fixes a bug where you couldn't use relay connection with lazy
types.

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

@bellini666 bellini666 force-pushed the fix_alias_lazy_type branch from 8e4983f to 3a1e0d5 Compare May 28, 2024 21:11
Copy link

codecov bot commented May 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.56%. Comparing base (4ba2379) to head (1a0de54).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3524      +/-   ##
==========================================
- Coverage   96.56%   96.56%   -0.01%     
==========================================
  Files         523      523              
  Lines       33322    33345      +23     
  Branches     5510     5512       +2     
==========================================
+ Hits        32178    32199      +21     
- Misses        911      913       +2     
  Partials      233      233              

Copy link

codspeed-hq bot commented May 28, 2024

CodSpeed Performance Report

Merging #3524 will not alter performance

Comparing fix_alias_lazy_type (1a0de54) with main (4ba2379)

Summary

✅ 12 untouched benchmarks

RELEASE.md Outdated Show resolved Hide resolved
@bellini666 bellini666 merged commit 63134b3 into main May 28, 2024
63 of 64 checks passed
@bellini666 bellini666 deleted the fix_alias_lazy_type branch May 28, 2024 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants