@types/graphql package and had problems.Definitions by: in index.d.ts) so they can respond.I download schema from apollo-tooling with command: apollo service:download. apollo-tooling use introspectionFromSchema to generate a graphql file. As a result, I use buildClientSchema to build the schema. However, @types/graphql throw error like this:
error TS2345: Argument of type '{ "__schema": { "queryType": { "name": string; }; "mutationType": { "name": string; }; "subscriptionType": null; "types": ({ "kind": string; "name": string; "description": string; "fields": ({ "name": string; "description": string; "args": { ...; }[]; "type": { ...; }; "isDeprecated": boolean; "deprecationReason": s...' is not assignable to parameter of type 'IntrospectionQuery'.
Types of property '__schema' are incompatible.
Type '{ "queryType": { "name": string; }; "mutationType": { "name": string; }; "subscriptionType": null; "types": ({ "kind": string; "name": string; "description": string; "fields": ({ "name": string; "description": string; "args": { ...; }[]; "type": { ...; }; "isDeprecated": boolean; "deprecationReason": string; } | { ....' is not assignable to type 'IntrospectionSchema'.
Types of property 'queryType' are incompatible.
Property 'kind' is missing in type '{ "name": string; }' but required in type 'IntrospectionNamedTypeRef<IntrospectionObjectType>'.
In graphql Introspection docs, Kind is not required for queryType. Is this a bug in @type/graphql?
I'm having the same issue. I used get-graphql-schema to download the schema, and it does not have "kind" for "queryType".
Running into the same issue here. Any news or workaround?
Same issue. Assumed it was some issue with incompatible GQL versions but tried all kinds of introspection query output with no success.
Follow up:
According to NPM NPM, these types are deprecated. The lib itself comes with types.
Yes, you should remove the @types/graphql and upgrade graphql.
Most helpful comment
I'm having the same issue. I used
get-graphql-schemato download the schema, and it does not have"kind"for"queryType".