graphql-spec
graphql-spec copied to clipboard
Add Appendix C - Built-in Definitions
As we dive into full schemas, introspection and more (see https://github.com/graphql/graphql-spec/pull/1036), I'd find it useful to have an authoritative source for built-in definitions that come with a GraphQL implementation (scalar, directives & introspection types).
It shows the built-in definition at a glance and makes it easy to diff, capture a change by looking at the git history. It's also nice for library authors because it uniformizes the descriptions.
The definitions are taken from graphql-js printIntrospectionSchema() with two small changes:
- I added the scalars definitions manually
- I carried over the
__Type.fields,__Type.interface, etc... descriptions from the current spec comments
I was doing this for my own needs so figured out I might as well contribute it to the spec but I'm happy to move it somewhere else if you think this doesn't belong in the spec.
Deploy Preview for graphql-spec-draft ready!
| Name | Link |
|---|---|
| Latest commit | 3cf473a7828509bba1435a9db308dc0475132997 |
| Latest deploy log | https://app.netlify.com/projects/graphql-spec-draft/deploys/685d8f6255c4820008a95131 |
| Deploy Preview | https://deploy-preview-1037--graphql-spec-draft.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Would that qualify as an editorial change?
The validation/execution behaviour is essentially unchanged. The main thing that could be considered a behaviour change is that the definitions proposed here contain descriptions. We could either:
- Remove descriptions
- Add language that mandates the implementations use the same description as in the spec
- Add language that the implementations are free to change the description if they want
- Leave as is
I guess there's a distinction to be made between:
- implementations MUST always support it and expose the definition in introspection:
@include,@defer, etc... - implementations MAY support it but it may not always be present in introspection:
@defer,@disableErrorPropagation, etc...
~So I'm questioning wether built-in definitions is the proper term there. Maybe just specified definitions? Or just definitions? Thoughts?~
Edit: I settled on "Type System Definitions"
Feedback from May wg:
- Put everything in one giant block
- Add a script to get the block from graphql-js (update graphql-js if some things are out of order)