Skip to content

Commit be5da5f

Browse files
committed
Include kind in the types
Replicates graphql/graphql-js@2562ce01
1 parent 3f722f7 commit be5da5f

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

docs/usage/introspection.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The ``data`` attribute of the introspection query result now gives us a dictiona
2828
which constitutes a third way of describing a GraphQL schema::
2929

3030
{'__schema': {
31-
'queryType': {'name': 'Query'},
31+
'queryType': {'name': 'Query', 'kind': 'OBJECT'},
3232
'mutationType': None, 'subscriptionType': None,
3333
'types': [
3434
{'kind': 'OBJECT', 'name': 'Query', 'description': None,

src/graphql/utilities/get_introspection_query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ def input_deprecation(string: str) -> str | None:
5858
query IntrospectionQuery {{
5959
__schema {{
6060
{maybe_schema_description}
61-
queryType {{ name }}
62-
mutationType {{ name }}
63-
subscriptionType {{ name }}
61+
queryType {{ name kind }}
62+
mutationType {{ name kind }}
63+
subscriptionType {{ name kind }}
6464
types {{
6565
...FullType
6666
}}

tests/type/test_introspection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def executes_an_introspection_query():
2424
assert result.errors is None
2525
assert result.data == {
2626
"__schema": {
27-
"queryType": {"name": "SomeObject"},
27+
"queryType": {"name": "SomeObject", "kind": "OBJECT"},
2828
"mutationType": None,
2929
"subscriptionType": None,
3030
"types": [

tests/utilities/test_build_client_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,7 @@ def throws_when_type_reference_is_missing_name():
740740
with pytest.raises(TypeError) as exc_info:
741741
build_client_schema(introspection)
742742

743-
assert str(exc_info.value) == "Unknown type reference: {}."
743+
assert str(exc_info.value) == "Unknown type reference: {'kind': 'OBJECT'}."
744744

745745
def throws_when_missing_kind():
746746
introspection = introspection_from_schema(dummy_schema)

0 commit comments

Comments
 (0)