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

feat: add missing fragment spread warnings #152

Merged
merged 7 commits into from
Jan 4, 2024
Merged

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Jan 4, 2024

This adds support for searching the imports for fragments, then it will check all the found fragments whether they are used in the GraphQL documents of the file you are working in. When we find unused fragments we will warn the user.

Resolves #153

Copy link

changeset-bot bot commented Jan 4, 2024

🦋 Changeset detected

Latest commit: 0c2a9ea

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 Minor

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


const imports = findAllImports(source);
const fragmentNames: Set<string> = new Set();
// TODO: this should be a module-specifier that maps to a loc and a list of fragment-names
Copy link
Member Author

@JoviDeCroock JoviDeCroock Jan 4, 2024

Choose a reason for hiding this comment

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

Still need to take care of this so we can show combined warnings and better locations for them

@JoviDeCroock JoviDeCroock merged commit 05da589 into main Jan 4, 2024
1 check passed
@JoviDeCroock JoviDeCroock deleted the warn-missing-spread branch January 4, 2024 13:04
This was referenced Jan 4, 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.

Ensure fragment-suggestions work with client-preset
1 participant