From: 
Subject: Debian changes

The Debian packaging of python-gql is maintained in git, using a workflow
similar to the one described in dgit-maint-merge(7).
The Debian delta is represented by this one combined patch; there isn't a
patch queue that can be represented as a quilt series.

A detailed breakdown of the changes is available from their canonical
representation -- git commits in the packaging repository.
For example, to see the changes made by the Debian maintainer in the first
upload of upstream version 1.2.3, you could use:

    % git clone https://git.dgit.debian.org/python-gql
    % cd python-gql
    % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian'

(If you have dgit, use `dgit clone python-gql`, rather than plain `git clone`.)

We don't use debian/source/options single-debian-patch because it has bugs.
Therefore, NMUs etc. may nevertheless have made additional patches.

---

diff --git a/gql/dsl.py b/gql/dsl.py
index 40c267b..fceee7b 100644
--- a/gql/dsl.py
+++ b/gql/dsl.py
@@ -1,8 +1,3 @@
-"""
-.. image:: https://www.plantuml.com/plantuml/png/hLZXJkGs4FwVft1_NLXOfBR_Lcrrz3Wg93WA2rTL24Kc6LYtMITdErpf5QdFqaVharp6tincS8ZsLlTd8PxnpESltun7UMsTDAvPbichRzm2bY3gKYgT9Bfo8AGLfrNHb73KwDofIjjaCWahWfOca-J_V_yJXIsp-mzbEgbgCD9RziIazvHzL6wHQRc4dPdunSXwSNvo0HyQiCu7aDPbTwPQPW-oR23rltl2FTQGjHlEQWmYo-ltkFwkAk26xx9Wb2pLtr2405cZSM-HhWqlX05T23nkakIbj5OSpa_cUSk559yI8QRJzcStot9PbbcM8lwPiCxipD3nK1d8dNg0u7GFJZfdOh_B5ahoH1d20iKVtNgae2pONahg0-mMtMDMm1rHov0XI-Gs4sH30j1EAUC3JoP_VfJctWwS5vTViZF0xwLHyhQ4GxXJMdar1EWFAuD5JBcxjixizJVSR40GEQDRwvJvmwupfQtNPLENS1t3mFFlYVtz_Hl4As_Rc39tOgq3A25tbGbeBJxXjio2cubvzpW7Xu48wwSkq9DG5jMeYkmEtsBgVriyjrLLhYEc4x_kwoNy5sgbtIYHrmFzoE5n8U2HdYd18WdTiTdR3gSTXKfHKlglWynof1FwVnJbHLKvBsB6PiW_nizWi2CZxvUWtLU9zRL0OGnw3vnLQLq8CnDNMbNwsYSDR-9Obqf3TwAmHkUh3KZlrtjPracdyYU1AlVYW1L6ctOAYlH3wcSunqJ_zY_86-_5YxHVLBCNofgQ2NLQhEcRZQg7yGO40gNiAM0jvQoxLm96kcOoRFepGMRii-Z0u_KSU3E84vqtO1w7aeWVUPRzywkt5xzp4OsN4yjpsZWVQgDKfrUN1vV7P--spZPlRcrkLBrnnldLp_Ct5yU_RfsL14EweZRUtL0aD4JGKn02w2g1EuOGNTXEHgrEPLEwC0VuneIhpuAkhibZNJSE4wpBp5Ke4GyYxSQF3a8GCZVoEuZIfmm6Tzk2FEfyWRnUNubR1cStLZzj6H8_dj17IWDc7dx3MujlzVhIWQ-yqeNFo5qsPsIq__xM8ZX0035B-8UTqWDD_IzD4uEns6lWJJjAmysKRtFQU8fnyhZZwEqSUsyZGSGxokokNwCXr9jmkPO6T2YRxY9SkPpT_W6vhy0zGJNfmDp97Bgwt2ri-Rmfj738lF7uIdXmQS2skRnfnpZhvBJ5XG1EzWYdot_Phg_8Y2ZSkZFp8j-YnM3QSI9uZ2y0-KeSwmKOvQJEGHWe_Qra5wgsINz6_-6VwJGQws8FDk74PXfOnuF4asYIy8ayJZRWm2w5sCmRKfAmS16IP01LxCH2nkPaY01oew5W20gp9_qdRwTfQj140z2WbGqioV0PU8CRPuEx3WSSlWi6F6Dn9yERkKJHYRFCpMIdTMe9M1HlgcLTMNyRyA8GKt4Y7y68RyMgdWH-8H6cgjnEilwwCPt-H5yYPY8t81rORkTV6yXfi_JVYTJd3PiAKVasPJq4J8e9wBGCmU070-zDfYz6yxr86ollGIWjQDQrErp7F0dBZ_agxQJIbXVg44-D1TlNd_U9somTGJmeARgfAtaDkcYMvMS0  # noqa
-    :alt: UML diagram - rename png to uml to edit
-"""
-
 import logging
 import re
 import sys
diff --git a/gql/utilities/get_introspection_query_ast.py b/gql/utilities/get_introspection_query_ast.py
index 3a59ced..cae56e5 100644
--- a/gql/utilities/get_introspection_query_ast.py
+++ b/gql/utilities/get_introspection_query_ast.py
@@ -1,10 +1,24 @@
 from itertools import repeat
 
 from graphql import DocumentNode, GraphQLSchema
+from graphql.utilities import get_introspection_query
 
 from gql.dsl import DSLFragment, DSLMetaField, DSLQuery, DSLSchema, dsl_gql
 
 
+def _schema_type_includes_kind() -> bool:
+    introspection_query = get_introspection_query()
+    return "queryType { name kind }" in introspection_query
+
+
+def _schema_type_fields(ds: DSLSchema):
+    fields = [ds.__Type.name]
+    if _schema_type_includes_kind():
+        fields.append(ds.__Type.kind)
+
+    return fields
+
+
 def get_introspection_query_ast(
     descriptions: bool = True,
     specified_by_url: bool = False,
@@ -37,9 +51,9 @@ def get_introspection_query_ast(
         schema.select(ds.__Schema.description)
 
     schema.select(
-        ds.__Schema.queryType.select(ds.__Type.name),
-        ds.__Schema.mutationType.select(ds.__Type.name),
-        ds.__Schema.subscriptionType.select(ds.__Type.name),
+        ds.__Schema.queryType.select(*_schema_type_fields(ds)),
+        ds.__Schema.mutationType.select(*_schema_type_fields(ds)),
+        ds.__Schema.subscriptionType.select(*_schema_type_fields(ds)),
     )
 
     schema.select(ds.__Schema.types.select(fragment_FullType))
@@ -128,16 +142,18 @@ def get_introspection_query_ast(
             ds.__InputValue.deprecationReason,
         )
 
-    fragment_TypeRef.select(
-        ds.__Type.kind,
-        ds.__Type.name,
-    )
+    fragment_TypeRef.select(ds.__Type.kind, ds.__Type.name)
 
     if type_recursion_level >= 1:
-        current_field = ds.__Type.ofType.select(ds.__Type.kind, ds.__Type.name)
+        if _schema_type_includes_kind():
+            of_type_fields = (ds.__Type.name, ds.__Type.kind)
+        else:
+            of_type_fields = (ds.__Type.kind, ds.__Type.name)
+
+        current_field = ds.__Type.ofType.select(*of_type_fields)
 
         for _ in repeat(None, type_recursion_level - 1):
-            parent_field = ds.__Type.ofType.select(ds.__Type.kind, ds.__Type.name)
+            parent_field = ds.__Type.ofType.select(*of_type_fields)
             parent_field.select(current_field)
             current_field = parent_field
 
diff --git a/gql/utilities/node_tree.py b/gql/utilities/node_tree.py
index 5f763e4..11ba237 100644
--- a/gql/utilities/node_tree.py
+++ b/gql/utilities/node_tree.py
@@ -92,4 +92,7 @@ def node_tree(
     # Ignore new field added in graphql-core 3.3.0a12 to keep output compatible
     ignored_keys.append("nullability_assertion")
 
+    # Ignore new field added in graphql-core 3.2.11 to keep output compatible
+    ignored_keys.append("description")
+
     return _node_tree_recursive(obj, ignored_keys=ignored_keys)
diff --git a/tests/starwars/test_dsl.py b/tests/starwars/test_dsl.py
index ca9137a..1f33e08 100644
--- a/tests/starwars/test_dsl.py
+++ b/tests/starwars/test_dsl.py
@@ -8,6 +8,7 @@ from graphql import (
     GraphQLInt,
     GraphQLList,
     GraphQLNonNull,
+    GraphQLSchema,
     IntValueNode,
     ListTypeNode,
     NamedTypeNode,
@@ -16,14 +17,12 @@ from graphql import (
     NullValueNode,
     Undefined,
 )
-from graphql import __version__ as graphql_version
 from graphql import (
     build_ast_schema,
     parse,
     print_ast,
 )
 from graphql.utilities import get_introspection_query
-from packaging import version
 
 from gql import Client, gql
 from gql.dsl import (
@@ -49,6 +48,10 @@ from ..conftest import strip_braces_spaces
 from .schema import StarWarsSchema
 
 
+def graphql_core_supports_is_one_of():
+    return hasattr(DSLSchema(GraphQLSchema()).__Type, "isOneOf")
+
+
 @pytest.fixture
 def ds():
     return DSLSchema(StarWarsSchema)
@@ -1089,8 +1092,8 @@ def test_get_introspection_query_ast(option):
 
 
 @pytest.mark.skipif(
-    version.parse(graphql_version) < version.parse("3.3.0a7"),
-    reason="Requires graphql-core >= 3.3.0a7",
+    not graphql_core_supports_is_one_of(),
+    reason="Requires graphql-core support for __Type.isOneOf",
 )
 @pytest.mark.parametrize("option", [True, False])
 def test_get_introspection_query_ast_is_one_of(option):
@@ -1121,8 +1124,8 @@ def test_get_introspection_query_ast_is_one_of(option):
 
 
 @pytest.mark.skipif(
-    version.parse(graphql_version) >= version.parse("3.3.0a7"),
-    reason="Test only for older graphql-core versions < 3.3.0a7",
+    graphql_core_supports_is_one_of(),
+    reason="Test only when graphql-core does not support __Type.isOneOf",
 )
 def test_get_introspection_query_ast_is_one_of_not_implemented_yet():
 
diff --git a/tests/test_transport.py b/tests/test_transport.py
index 7c2a5a8..be517e1 100644
--- a/tests/test_transport.py
+++ b/tests/test_transport.py
@@ -1,3 +1,4 @@
+import json
 import os
 
 import pytest
@@ -25,6 +26,21 @@ def use_cassette(name):
     return query_vcr.use_cassette(name + ".yaml")
 
 
+def get_introspection_from_cassette():
+    import yaml
+
+    cassette_path = os.path.join(
+        os.path.dirname(__file__), "fixtures", "vcr_cassettes", "queries.yaml"
+    )
+
+    with open(cassette_path) as cassette_file:
+        cassette = yaml.safe_load(cassette_file)
+
+    return json.loads(cassette["interactions"][0]["response"]["body"]["string"])[
+        "data"
+    ]
+
+
 @pytest.fixture
 def client():
     import requests
@@ -42,10 +58,7 @@ def client():
             transport=RequestsHTTPTransport(
                 url=URL, cookies={"csrftoken": csrf}, headers={"x-csrftoken": csrf}
             ),
-            fetch_schema_from_transport=True,
-            introspection_args={
-                "input_value_deprecation": False,
-            },
+            introspection=get_introspection_from_cassette(),
         )
 
 
diff --git a/tests/test_transport_batch.py b/tests/test_transport_batch.py
index 671858e..18c6e7a 100644
--- a/tests/test_transport_batch.py
+++ b/tests/test_transport_batch.py
@@ -1,3 +1,4 @@
+import json
 import os
 
 import pytest
@@ -25,6 +26,21 @@ def use_cassette(name):
     return query_vcr.use_cassette(name + ".yaml")
 
 
+def get_introspection_from_cassette():
+    import yaml
+
+    cassette_path = os.path.join(
+        os.path.dirname(__file__), "fixtures", "vcr_cassettes", "queries_batch.yaml"
+    )
+
+    with open(cassette_path) as cassette_file:
+        cassette = yaml.safe_load(cassette_file)
+
+    return json.loads(cassette["interactions"][0]["response"]["body"]["string"])[
+        "data"
+    ]
+
+
 @pytest.fixture
 def client():
     import requests
@@ -42,10 +58,7 @@ def client():
             transport=RequestsHTTPTransport(
                 url=URL, cookies={"csrftoken": csrf}, headers={"x-csrftoken": csrf}
             ),
-            fetch_schema_from_transport=True,
-            introspection_args={
-                "input_value_deprecation": False,
-            },
+            introspection=get_introspection_from_cassette(),
         )
 
 
