-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add oneOf blog post #2011
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
base: source
Are you sure you want to change the base?
Add oneOf blog post #2011
Changes from 1 commit
4e7dc06
aa21cb1
5f4de93
ddb3138
89b99e5
2f9b6b6
b56e592
b523e03
7f32a5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,6 +99,42 @@ input GalleryInput { | |
including Ruby, Java, JavaScript and .NET already ship `@oneOf` as a stable | ||
feature | ||
|
||
You might wonder why this is expressed as a directive in SDL rather than | ||
explicitly having a new type keyword; Brad Baker, contributor to GraphQL-Java, | ||
summed it up in [this comment back in | ||
2023](https://github.com/graphql/graphql-spec/pull/825#issuecomment-1659900665): | ||
|
||
> use of the directive means that: | ||
> | ||
> - it's minimally invasive in terms of SDL tooling that might be out there, | ||
> - it's minimally invasive in terms of Introspection, | ||
> - it's minimally invasive in terms of engine implementation, it proved quite easy to implement in graphql-java. | ||
> | ||
> Great stuff! | ||
|
||
Since then there have been a number of reports of success: | ||
|
||
> I'm very happy with where this landed. We'd use it internally at my company. -- [Ethan Resnick](https://github.com/graphql/graphql-spec/pull/825#issuecomment-2128262620) | ||
|
||
> More positive feedback: We are using it at HubSpot through the graphql-java implementation and look forward to it becoming standardized. -- [Henry Q. Dineen](https://github.com/graphql/graphql-spec/pull/825#issuecomment-2128324080) | ||
|
||
> I implemented support for OneOf input objects for the Caliban GraphQL library (Scala) [...] it's been fairly straightforward implementing support for it and I couldn't really identify any areas that could have been improved. -- [kyri-petrou](https://github.com/kyri-petrou) | ||
|
||
> We have been eagerly waiting at Jobber for this to land as well. [...] We have many use cases internally for it and we're very excited to see this land! -- [Clinton Pahl](https://github.com/graphql/graphql-spec/pull/825#issuecomment-2135724148) | ||
|
||
> Colleagues at work (Atlassian) have been really happy with @oneOf, works exactly as you want it to and I haven't heard any negative feedback. -- [Donna Zhou](https://github.com/dondonz) | ||
|
||
## Availability | ||
|
||
`@oneOf` is already available in the following implementations of GraphQL: | ||
|
||
- GraphQL.js v16+ | ||
- GraphQL Ruby v2.0.21+ | ||
- GraphQL.NET v8+ | ||
- GraphQL Java v21.2+ | ||
- HotChocolate v16.0.0+ | ||
- Probably others! | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @graphql/implementers If you already support There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://strawberry.rocks/docs/types/input-types#one-of-input-types we support it :D There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. GraphQL core does too https://github.com/graphql-python/graphql-core There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We just added support to https://github.com/webonyx/graphql-php. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @patrick91 and @spawnia; fancy adding suggestions in the style of the others (i.e. with version numbers)? For GraphQL Core, do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So does Yoga and Hive Gateway! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @enisdenjo! I'm currently only listing GraphQL implementations otherwise the list would get too long! Most things that consumes one of these implementations should support |
||
|
||
## The bottom line | ||
|
||
`@oneOf` allows for more expressive, capable, and less overwhelming schemas, | ||
|
Uh oh!
There was an error while loading. Please reload this page.