Skip to content

Commit

Permalink
Include kind in the types (#4222)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JoviDeCroock authored and erikwrede committed Oct 17, 2024
1 parent 6d838f2 commit 99ada95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/type/__tests__/introspection-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('Introspection', () => {
expect(result).to.deep.equal({
data: {
__schema: {
queryType: { name: 'SomeObject' },
queryType: { name: 'SomeObject', kind: 'OBJECT' },
mutationType: null,
subscriptionType: null,
types: [
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/__tests__/buildClientSchema-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ describe('Type System: build schema from introspection', () => {
delete introspection.__schema.queryType.name;

expect(() => buildClientSchema(introspection)).to.throw(
'Unknown type reference: {}.',
'Unknown type reference: { kind: "OBJECT" }.',
);
});

Expand Down
6 changes: 3 additions & 3 deletions src/utilities/getIntrospectionQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export function getIntrospectionQuery(options?: IntrospectionOptions): string {
query IntrospectionQuery {
__schema {
${schemaDescription}
queryType { name }
mutationType { name }
subscriptionType { name }
queryType { name kind }
mutationType { name kind }
subscriptionType { name kind }
types {
...FullType
}
Expand Down

0 comments on commit 99ada95

Please sign in to comment.