Add a note about omitting introspection type definitions#1036
Add a note about omitting introspection type definitions#1036martinbonnin wants to merge 3 commits intographql:mainfrom
Conversation
✅ Deploy Preview for graphql-spec-draft ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Co-authored-by: Benjie <benjie@jemjie.com>
|
Based on Aug 3th WG discussion: I think we can untangle this change from scalars and direcives by saying that you have two options:
We can't tangle it with scalars because currently below is a valid behaviours for scalars: |
|
However, it creates a slightly different problem since introspection for the Query root type doesn't contain |
|
Thanks for circling back on this!
Edit, I'm re-reading myself and I think I got it wrong. I actually want introspection types even if
I'm confused. The spec says: It's a "must" so my understanding is (in the current form at least), scalar type definitions must never be present in a SDL document?
|
|
Feels like we could do this by adding an + enum __IncludeMeta { NONE ALL ALL_EXCEPT_TYPENAME }
type __Type {
# ...
fields(
includeDeprecated: Boolean = false
+ includeMeta: __IncludeMeta = NONE
): [__Field!] |
|
Closing in favor of #1049 |
Updates `SchemaBuilder` to allow SDL to contain built-in meta types (e.g. `__Type`) redefinitions. GraphQL spec doesn't really define the expected behavior for handling SDL with redeclared meta fields (see: [#1036](graphql/graphql-spec#1036), [#1049](graphql/graphql-spec#1049)). `graphql-js` [reference implementation](https://github.com/graphql/graphql-js/blob/v16.11.0/src/utilities/extendSchema.ts#L187) simply ignores those redefinitions even if the underlying type definitions don't match. This PR updates `ignore_builtin_redefinitions` option to also ignore meta types redefinitions (previously it was only allowing built-in scalar redefinitions #990).
Updates `SchemaBuilder` to allow SDL to contain built-in meta types (e.g. `__Type`) redefinitions. GraphQL spec doesn't really define the expected behavior for handling SDL with redeclared meta fields (see: [#1036](graphql/graphql-spec#1036), [#1049](graphql/graphql-spec#1049)). `graphql-js` [reference implementation](https://github.com/graphql/graphql-js/blob/v16.11.0/src/utilities/extendSchema.ts#L187) simply ignores those redefinitions even if the underlying type definitions don't match. This PR updates `ignore_builtin_redefinitions` option to also ignore meta types redefinitions (previously it was only allowing built-in scalar redefinitions #990).
There is a similar note
for scalars:
for directives:
I didn't find anything for introspection types.