graphql-typed-client icon indicating copy to clipboard operation
graphql-typed-client copied to clipboard

Generated code can have implicit any

Open DanielRose opened this issue 5 years ago • 0 comments

For all unions/interfaces/objects in the GraphQL schema, the generated code includes a "type-guard" called is{name}, which uses a string array {name}_possibleTypes with the type-names implementing the source value. That array implicitly typed, however.

If the schema includes unused interfaces, the array will be empty, and the array is implicitly typed as any[]. If the Typescript compiler setting noImplicitAny is used, that is a compile error.

DanielRose avatar Aug 31 '20 11:08 DanielRose