vektah/gqlparser

gqlparser should be more flexible about built-in directives

Closed this issue · 1 comments

A user of genqlient reported an issue (Khan/genqlient#200) which turned out to be that their schema, generated by get-graphql-schema via introspection, did not contain the built-in scalars, but did contain the built-in @specifiedBy directive. While ideally get-graphql-schema might not do that, it's actually within spec: the spec says

When representing a GraphQL schema using the type system definition language any built-in directive may be omitted for brevity.
whereas
When representing a GraphQL schema using the type system definition language, all built-in scalars must be omitted for brevity.

So ideally gqlparser should allow this! It's unclear to me if it's appropriate to validate that the provided definition matches the expected one, or just use it anyway.

Yeah, I would think gqlparser should allow any or all built-in directives to be omitted. I would love to get a PR for this.