Skip to content

Commit 8a00033

Browse files
committed
polish(introspection): cover __Type.description on wrapping types
Replicates graphql/graphql-js@8eef99d
1 parent 1d1383a commit 8a00033

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

‎tests/type/test_introspection.py‎

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,66 @@ def exposes_descriptions():
17241724
None,
17251725
)
17261726

1727+
def returns_null_for_descriptions_of_wrapping_types():
1728+
schema = build_schema(
1729+
'''
1730+
"""Object description"""
1731+
type SomeObject {
1732+
listField: [SomeObject]
1733+
nonNullField: SomeObject!
1734+
}
1735+
1736+
schema {
1737+
query: SomeObject
1738+
}
1739+
'''
1740+
)
1741+
1742+
source = """
1743+
{
1744+
__type(name: "SomeObject") {
1745+
description
1746+
fields {
1747+
name
1748+
type {
1749+
kind
1750+
description
1751+
ofType {
1752+
description
1753+
}
1754+
}
1755+
}
1756+
}
1757+
}
1758+
"""
1759+
1760+
assert graphql_sync(schema=schema, source=source) == (
1761+
{
1762+
"__type": {
1763+
"description": "Object description",
1764+
"fields": [
1765+
{
1766+
"name": "listField",
1767+
"type": {
1768+
"kind": "LIST",
1769+
"description": None,
1770+
"ofType": {"description": "Object description"},
1771+
},
1772+
},
1773+
{
1774+
"name": "nonNullField",
1775+
"type": {
1776+
"kind": "NON_NULL",
1777+
"description": None,
1778+
"ofType": {"description": "Object description"},
1779+
},
1780+
},
1781+
],
1782+
},
1783+
},
1784+
None,
1785+
)
1786+
17271787
def executes_introspection_query_without_calling_global_resolvers():
17281788
schema = build_schema(
17291789
"""

0 commit comments

Comments
 (0)