relay
relay copied to clipboard
Add code action to create missing fragment argument
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.