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(lsp): nested call expressions #319

Merged
merged 3 commits into from
May 13, 2024
Merged

Conversation

JoviDeCroock
Copy link
Member

This adds support for inline defined graphql-strings, auto-complete and quick-info always worked however diagnostics/... did not.

useQuery({ query: graphql(``) })

This is slightly less performant as we traverse deeper but seems worth it

Fixes #316

Copy link

changeset-bot bot commented May 13, 2024

🦋 Changeset detected

Latest commit: a0bf5be

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 requested a review from kitten May 13, 2024 17:17
@@ -158,7 +158,7 @@ export const resolveTadaFragmentArray = (
if (node.elements.every(ts.isIdentifier)) return node.elements;
const identifiers: ts.Identifier[] = [];
for (let element of node.elements) {
while (ts.isPropertyAccessExpression(element)) element = element.expression;
while (ts.isPropertyAccessExpression(element)) element = element.name;
Copy link
Member Author

Choose a reason for hiding this comment

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

This looks like it was refactored the wrong way, if we keep accessing the expression we'll reach the top-element i.e. fields.fragment we'll get fields rather than fragment

@JoviDeCroock JoviDeCroock merged commit b153ce1 into main May 13, 2024
1 check passed
@JoviDeCroock JoviDeCroock deleted the fix-nested-call-expressions branch May 13, 2024 17:22
@github-actions github-actions bot mentioned this pull request May 13, 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.

Unused co-located fragment definition(s) false-negatives?
2 participants