You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Our schema at Shopify includes a redeclaration of the ID type, with an updated description documentation on its expected format for our endpoints. This is valid schema, but attempting to generate using it results in the following error:
go run github.com/Khan/genqlient
prelude.graphql:16: invalid schema: Cannot redeclare type ID.
exit status 1
To Reproduce
Create and use a schema with a custom ID type, e.g.
"""Represents a unique identifier that is Base64 obfuscated. It is often used torefetch an object or as key for a cache. The ID type appears in a JSON responseas a String; however, it is not intended to be human-readable. When expected asan input type, any string (such as `"VXNlci0xMA=="`) or integer (such as `4`)input value will be accepted as an ID."""scalarID
Expected behavior
The duplicated scalar is not treated as an error.
genqlient version
v0.5.0
The text was updated successfully, but these errors were encountered:
Ugh, the vagueness of the spec's language about schema validation bites us again :( . I feel gqlparser made better decisions here (by saying you don't get to redefine anything, even builtins), but sadly where the spec is vague we probably just have to match what graphql-js does since that's the de-facto standard.
So I think we will need to go the same route we did with directives in vektah/gqlparser#226, and have the parser allow repeated builtin types (scalars and introspection types) just as it now allows repeated builtin directives. CC @StevenACoffman in case you have any thoughts; in theory we could also fix this up in genqlient but it seems kinda silly. (We'll also need to update the stuff from #205; maybe we can just remove it actually, which would be great.)
Describe the bug
Our schema at Shopify includes a redeclaration of the ID type, with an updated description documentation on its expected format for our endpoints. This is valid schema, but attempting to generate using it results in the following error:
To Reproduce
Create and use a schema with a custom
ID
type, e.g.Expected behavior
The duplicated scalar is not treated as an error.
genqlient version
v0.5.0
The text was updated successfully, but these errors were encountered: