graphql-to-json-schema
graphql-to-json-schema copied to clipboard
ID scalar is wrongfully declared with "type": "object"
According to the specification the ID scalar can be "integer" or "string" when used as an input and only "string" when used as an output: https://spec.graphql.org/June2018/#sec-ID
Currently it's represented as "type": "object" in the JSON schema which seems wrong. In my opinion it should be "type": ["string", "integer"] Kind of hard to decide which is more appropriate, since the possible values change depending on the usage of the scalar as either input or output. However ["string", "integer"] seems a lot closer to the specification than "object".
Can you please:
- Provided a small sample SDL that will replicate what you're talking about
- Provide the output you're seeing from using that SDL
- Provide the output you're expecting
@newhouse like for nullable array, we could have an option like IdTypeMapping: 'string' | 'integer' = 'string'
to specify which type should ID
resolve to.
wdyt?