From 98fc85f1f613201b9910c5a4d6211e5834c8ce5b Mon Sep 17 00:00:00 2001
From: jdecroock <decroockjovi@gmail.com>
Date: Thu, 10 Oct 2024 12:12:00 +0200
Subject: [PATCH] Include kind in the types

---
 src/type/__tests__/introspection-test.ts          | 2 +-
 src/utilities/__tests__/buildClientSchema-test.ts | 2 +-
 src/utilities/getIntrospectionQuery.ts            | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/type/__tests__/introspection-test.ts b/src/type/__tests__/introspection-test.ts
index c914570713..803e346834 100644
--- a/src/type/__tests__/introspection-test.ts
+++ b/src/type/__tests__/introspection-test.ts
@@ -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: [
diff --git a/src/utilities/__tests__/buildClientSchema-test.ts b/src/utilities/__tests__/buildClientSchema-test.ts
index 0ad292d03a..4fd2dbcd34 100644
--- a/src/utilities/__tests__/buildClientSchema-test.ts
+++ b/src/utilities/__tests__/buildClientSchema-test.ts
@@ -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" }.',
       );
     });
 
diff --git a/src/utilities/getIntrospectionQuery.ts b/src/utilities/getIntrospectionQuery.ts
index 9fc8963fa0..b516dda39e 100644
--- a/src/utilities/getIntrospectionQuery.ts
+++ b/src/utilities/getIntrospectionQuery.ts
@@ -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
         }