Skip to content
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

Printing the @oneOf directive #3968

Closed
hayes opened this issue Sep 8, 2023 · 1 comment · Fixed by #3969
Closed

Printing the @oneOf directive #3968

hayes opened this issue Sep 8, 2023 · 1 comment · Fixed by #3969
Labels

Comments

@hayes
Copy link
Contributor

hayes commented Sep 8, 2023

It looks like currently the printSchema function doesn't have any handling for @oneOf.

I'm not sure if this is intentional or not, because I know printing directives has historically been a controversial topic, but my expectation would be that for directives that are part of the spec and have a corresponding option in the options when creating the type/field in code (eg deprecationReason/@deprecated ) would be printed when using printSchema.

I'm happy to make a PR to add this, and it looks like it should be a pretty simple fix handled here: https://github.com/graphql/graphql-js/blob/main/src/utilities/printSchema.ts#L207C5-L207C5

@benjie
Copy link
Member

benjie commented Oct 7, 2023

Thanks for spotting this! Can confirm that the RFC definitely states the directive should be present; this isn't "metadata" (unlike graphql/graphql-spec#300) - it's a concrete __Type.isOneOf introspection field and without this we'd lose introspection<->SDL equivalence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants