-
Notifications
You must be signed in to change notification settings - Fork 2k
The result of getIntrospectionQuery
does not match IntrospectionQuery
type
#3409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Bumping this. |
Still seeing this issue. At the moment, chucking in a Exact same situation, passing an introspection in JSON into import * as introspectionResult from "../../../graphql.schema.json";
const schema = buildClientSchema(introspectionResult); Produces the following error:
Other issues downstream in users of this library:
|
Wondered if making kind option would be enough, and it creates further problems upstream. export interface IntrospectionNamedTypeRef<
T extends IntrospectionType = IntrospectionType,
> {
readonly kind?: T['kind'];
readonly name: string;
} |
@IvanGoncharov is it simply a matter of fixing |
Or is that silly because the kind is obvious for root types? And we need a new introspection type for root types? |
Supersedes graphql/graphql-js#3910 Fixes graphql/graphql-js#3909 Fixes graphql/graphql-js#3409 This puts the Selection-set in line with the expected type
getIntrospectionQuery
only requests thename
field from the rootqueryType
object(https://github.com/graphql/graphql-js/blob/6e48d16f92b9a6df8638b1486354c6be2537033b/src/utilities/getIntrospectionQuery.ts)
yet the
IntrospectionQuery
datatype definesqueryType
asIntrospectionNamedTypeRef
(https://github.com/graphql/graphql-js/blob/main/src/utilities/getIntrospectionQuery.ts#L167) which requireskind
as wellThis means that copying the result of the querying a GQL API with the introspection query as JSON and trying to assign to
IntrospectionQuery
will fail with:The text was updated successfully, but these errors were encountered: