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(graphqlsp): Fix resolving fragments as assignments #322

Merged
merged 1 commit into from
May 27, 2024

Conversation

kitten
Copy link
Member

@kitten kitten commented May 27, 2024

Resolves #321

Summary

This fixes resolving fragments from binary assignments, even if the fragment is referenced as an identifier, e.g.

x.fragment = Fragment;
x.y.fragment = Fragment;
x.y.fragment = graphql(/*...*/);

Set of changes

  • in unrollFragment
    • Detect property access expression chain in assignment
    • Detect and resolve binary expressions
    • Recurse if an identifier is found

@kitten kitten requested a review from JoviDeCroock May 27, 2024 09:17
Copy link

changeset-bot bot commented May 27, 2024

🦋 Changeset detected

Latest commit: d536a96

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@0no-co/graphqlsp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@JoviDeCroock JoviDeCroock merged commit 1d5d9a6 into main May 27, 2024
1 check passed
@JoviDeCroock JoviDeCroock deleted the fix/property-assignment-by-ref-fragment branch May 27, 2024 09:29
@github-actions github-actions bot mentioned this pull request May 27, 2024
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.

Unknown fragment error when the fragment is defined as an object field
2 participants