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

Relax non-inclusion of schema definition. #1047

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ddebrunner
Copy link

@ddebrunner ddebrunner commented Sep 27, 2023

"should" seems too strong here given a schema can have a description and directives applied to it.

@linux-foundation-easycla
Copy link

CLA Not Signed

@netlify
Copy link

netlify bot commented Sep 27, 2023

Deploy Preview for graphql-spec-draft ready!

Name Link
🔨 Latest commit 6fc6d63
🔍 Latest deploy log https://app.netlify.com/sites/graphql-spec-draft/deploys/65142564607d86000882d4d6
😎 Deploy Preview https://deploy-preview-1047--graphql-spec-draft.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@martinbonnin
Copy link
Contributor

One alternative would be to add more conditions to the "should"?

"Likewise, when representing a GraphQL schema using the type system definition
language, a schema definition should be omitted if each root operation type
uses its respective default root type name, no other type uses any default
root type name
and no schema directives are present."

I kind of like the "brevity by default" recommendation.

@ddebrunner
Copy link
Author

and no description ...

@benjie
Copy link
Member

benjie commented Sep 28, 2023

We should keep the should for consistency - best that everyone generates the same SDL for the same schema where possible.

So I support @martinbonnin's proposal that we further narrow this case. I think the description was an oversight of #466 - that's the main thing to include right now.

Note that there are no directives that would be visible on a schema keyword currently when the schema is printed (via introspection results) as SDL. The only directives currently included when representing a schema as SDL are @deprecated and @specifiedBy, though this may change when #300 is addressed. (This is not true for the source SDL, but that's not what we're talking about here.)

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

Successfully merging this pull request may close these issues.

3 participants