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

Add code action to create missing fragment argument #4681

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tobias-tengler
Copy link
Contributor

@tobias-tengler tobias-tengler commented Apr 21, 2024

Depends on #4680

This renames the GlobalVariables error to ExpectedOperationVariableToBeDefined and emits the error for each problematic variable identifier, instead of a single error for multiple infringements. Also extends the error to include the variable name and type in the diagnostic data. Using this data we create a code action that appends the missing argument with the correct type to the fragment arguments (only using @argumentDefinitions for now).
No diagnostic is emitted for orphan fragments that aren't referenced in an operation. I plan on supporting this case and add a refactor for global variables in a later PR.

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.

None yet

2 participants