-
Notifications
You must be signed in to change notification settings - Fork 2k
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
oneof: add test case #4034
base: main
Are you sure you want to change the base?
oneof: add test case #4034
Conversation
✅ Deploy Preview for compassionate-pike-271cb3 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Hi @yaacovCR, I'm @github-actions bot happy to help you with this PR 👋 Supported commandsPlease post this commands in separate comments and only one per comment:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should throw an error 🤔 based on All Variable Uses Defined
The question is kind of moot because the query is meaningless having a variable reference that's not defined; but yes this should fail the "OneOf Input Objects Have Exactly One Field" validation rule:
If you define the variable |
Have to check back on this |
this test currently passes. should it?
At issue is whether oneof coercion should also check the pre-coerced provided value for the correct number of keys. Currently, it doesn't, although it seems that the proposed spec edits suggests that it should, although the discussion on the issue seems open.
[Similarly, we currently also get an error message of incorrect number of keys if a single misspelled key is provided, in addition to the error about the misspelling, and we don't get an incorrect key if an extra key is given if it is misspelled. All of these stem from the same issue, so graphql-js is currently internally consistent].
@benjie @erikkessler1
links:
graphql/graphql-spec#825
graphql/graphql-spec#825
graphql/graphql-spec#825