10000 fix validation failure with variables in multiple operations by cmtm · Pull Request #1669 · async-graphql/async-graphql · GitHub
[go: up one dir, main page]

Skip to content

fix validation failure with variables in multiple operations #1669

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cmtm
Copy link
Contributor
@cmtm cmtm commented Feb 7, 2025

When a document with multiple operations has variables with different types, a validation error would occur, because the validation checked that the type of the variable matched the type of all places it's used. In multi-operation documents, variables only apply to the selected operation.

Don't check argument types that are variables when in unselected operations.

@cmtm
Copy link
Contributor Author
cmtm commented Feb 7, 2025

An alternative implementation would be to not do any validation on non-selected operations. That would be a larger functionality change, but would make the code simpler.

@cmtm cmtm force-pushed the fix-multi-operation-validation branch from 16c2b65 to 56f0cda Compare February 7, 2025 22:44
When a document with multiple operations has variables with different
types, a validation error would occur, because the validation checked
that the type of the variable matched the type of *all* places it's
used. In multi-operation documents, variables only apply to the selected
operation.

Don't check argument types that are variables when in unselected
operations.
@cmtm cmtm force-pushed the fix-multi-operation-validation branch from 56f0cda to 0b79869 Compare February 7, 2025 22:47
@cmtm
Copy link
Contributor Author
cmtm commented May 15, 2025

bump on this for comment/review

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.

1 participant
0