-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Write about @oneOf in the graphql-js documentation
#4290
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
Conversation
|
Hi @JoviDeCroock, 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:
|
@oneOf@oneOf in the graphql-js documentation
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.
Really great to add some documentation about @oneOf!
website/pages/input-unions.mdx
Outdated
| @@ -0,0 +1,72 @@ | |||
| --- | |||
| title: Input Unions | |||
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.
@oneOf is not equivalent to "input union". You can use it to form an input union, but its use is broader than that. I would title it "OneOf input objects" or similar.
(Example: input UserSpecifier @oneOf { databaseId: Int, username: String, hospitalNumber: Int } - note that both databaseId and hospitalNumber are Int and can uniquely identify a user in different ways - so this isn't simply a union.)
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.
My hesitancy was mainly that it's less of a clickthrough as the name is opaque to people while a general known word helps. I do agree that they are not the same
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 agree; perhaps the URL would be oneof and the title would be "OneOf and input unions" or similar?
aa90b7d to
a2658fa
Compare
a2658fa to
b691508
Compare
b691508 to
d96b462
Compare
|
The SDL changes need reflection in the code version I think? |
d96b462 to
34a6ed7
Compare
Co-authored-by: Benjie <[email protected]>
Currently input-unions and by extension the `@oneOf` directive aren't present in the documentation. I have opted to put this into the advanced section. The copy might be up for improvement, honestly fire away if there's more cases to cover, just wanted to get the ball rolling here. CC @benjie --------- Co-authored-by: Benjie <[email protected]>
Currently input-unions and by extension the `@oneOf` directive aren't present in the documentation. I have opted to put this into the advanced section. The copy might be up for improvement, honestly fire away if there's more cases to cover, just wanted to get the ball rolling here. CC @benjie --------- Co-authored-by: Benjie <[email protected]>
Currently input-unions and by extension the `@oneOf` directive aren't present in the documentation. I have opted to put this into the advanced section. The copy might be up for improvement, honestly fire away if there's more cases to cover, just wanted to get the ball rolling here. CC @benjie --------- Co-authored-by: Benjie <[email protected]>
Currently input-unions and by extension the `@oneOf` directive aren't present in the documentation. I have opted to put this into the advanced section. The copy might be up for improvement, honestly fire away if there's more cases to cover, just wanted to get the ball rolling here. CC @benjie --------- Co-authored-by: Benjie <[email protected]>
Currently input-unions and by extension the `@oneOf` directive aren't present in the documentation. I have opted to put this into the advanced section. The copy might be up for improvement, honestly fire away if there's more cases to cover, just wanted to get the ball rolling here. CC @benjie --------- Co-authored-by: Benjie <[email protected]>
Currently input-unions and by extension the `@oneOf` directive aren't present in the documentation. I have opted to put this into the advanced section. The copy might be up for improvement, honestly fire away if there's more cases to cover, just wanted to get the ball rolling here. CC @benjie --------- Co-authored-by: Benjie <[email protected]>
Currently input-unions and by extension the
@oneOfdirective aren't present in the documentation. I have opted to put this into the advanced section. The copy might be up for improvement, honestly fire away if there's more cases to cover, just wanted to get the ball rolling here.CC @benjie