Open
Conversation
✅ Deploy Preview for graphql-spec-draft ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
|
Excellent catch! I think we can and should fast track this. Once you have the GraphQL.js implementation in place either add it to the next GraphQL WG agenda or let me know if you’d rather I represent it on your behalf. |
9 tasks
benjie
requested changes
Feb 17, 2026
Member
benjie
left a comment
There was a problem hiding this comment.
Let's change the named type to an assertion for clarity
Comment on lines
+1813
to
+1819
| - Let {namedFieldType} be the underlying named type of {fieldType}. | ||
| - If {namedFieldType} is not an Input Object type: | ||
| - Return {true}. | ||
| - If {namedFieldType} is not a _OneOf Input Object_: | ||
| - Return {true}. | ||
| - If {OneOfInputObjectCanBeProvidedAFiniteValue(namedFieldType, nextVisited)}: | ||
| - Return {true}. |
Member
There was a problem hiding this comment.
Suggested change
| - Let {namedFieldType} be the underlying named type of {fieldType}. | |
| - If {namedFieldType} is not an Input Object type: | |
| - Return {true}. | |
| - If {namedFieldType} is not a _OneOf Input Object_: | |
| - Return {true}. | |
| - If {OneOfInputObjectCanBeProvidedAFiniteValue(namedFieldType, nextVisited)}: | |
| - Return {true}. | |
| - Assert: {fieldType} is a named type. | |
| - If {fieldType} is not an Input Object type: | |
| - Return {true}. | |
| - If {fieldType} is not a _OneOf Input Object_ type: | |
| - Return {true}. | |
| - If {OneOfInputObjectCanBeProvidedAFiniteValue(fieldType, nextVisited)}: | |
| - Return {true}. |
This was referenced Feb 17, 2026
viaductbot
pushed a commit
to airbnb/viaduct
that referenced
this pull request
Feb 17, 2026
viaduct.arbitrary.graphql is a suite of generators used to property test Viaduct and other internal airbnb systems. The generators in this package use a model for GraphQL values, which can be applied to GraphQL objects that require them. Examples of this include the default values for a graphql argument definition, the arguments/variables used in a GraphQL document, or the result of executing a selection set. This value model has evolved over time -- the initial `RawValue` family of types has been gradually replaced with an `IR.Value` model. Currently, both models exist in the code base and are used for slightly different jobs. This PR completely removes the `RawValue` model and updates all systems to use `IR.Value`. Along the way it also updates most components to operate on a ViaductSchema rather than graphql-java's GraphQLSchema. **Better Edgecase Coverage** Before this change, the schema generator would assign default values and applied directives as it generated each type. This created complexity in other parts of the system (eg value generators had to know how to not generate a value for a type that hadn't been defined yet), and made it impossible for the system to generate some kinds of edge cases. This PR changes this behavior to insert default values and applied directives as additional passes, after all types have been generated. This simplifies value generation and allows for more kinds of edge cases to be generated. This ability to generate more edge cases has surfaced some novel issues, such as this potential spec issue with OneOf types: graphql/graphql-spec#1211 Github-Change-Id: 998226 GitOrigin-RevId: 6ae10823b358faf51f883d593d33d6767933ee8b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OneOf types can form graphs for which finite values cannot be created.
The simplest example of this is a self-recursing OneOf type:
While this is the simplest form of the issue, we can build more complex examples from trees where every type is a OneOf:
These kinds of types are considered valid on two fronts today:
While this follows the letter of the Circular References part of the spec, it violates the spirit of the spec in that there is no way to create a legal value for these types.
I propose that in keeping with the spirit of the Circular References section, that these topologies be declared invalid. I took a stab at clarifying the spec around these kinds of types. With a provisional thumbs-up I'll plan on adding validation to graphql-js and graphql-java.