graphql-code-generator
graphql-code-generator copied to clipboard
Typescript: GraphQL type [String] should allow single strings
If I have following input schema:
input Test {
value: [String]!
}
The resulting Typescript schema looks like this:
value: Array<Maybe<Scalars['String']>>;
So Typescript only allows arrays as "value" for an instance of "Test". But GraphQL specifications would allow a single sting.
I would expect the Typescript schema of "value" to look like this:
value: Array<Maybe<Scalars['String']>> | Maybe<Scalars['String']>;
What do you think? Does it sound useful?
Thank you @draco2007 , tracking this here: https://github.com/dotansimha/graphql-code-generator/issues/4888