Skip to content

Commit 01cba7c

Browse files
committed
Add test for input object type in build_ast_schema
1 parent 0d4f952 commit 01cba7c

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

graphql/utils/tests/test_build_ast_schema.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pytest import raises
22

3-
from graphql import parse
3+
from graphql import GraphQLInt, parse
44
from graphql.utils.build_ast_schema import build_ast_schema
55
from graphql.utils.schema_printer import print_schema
66

@@ -392,6 +392,25 @@ def test_input_object():
392392
assert output == body
393393

394394

395+
def test_input_types_are_read():
396+
schema = build_ast_schema(parse("""
397+
schema {
398+
query: Query
399+
}
400+
401+
type Query {
402+
field(input: Input): Int
403+
}
404+
405+
input Input {
406+
id: Int
407+
}
408+
"""))
409+
410+
input_type = schema.get_type("Input")
411+
assert input_type.fields["id"].type == GraphQLInt
412+
413+
395414
def test_simple_argument_field_with_default():
396415
body = '''
397416
schema {

0 commit comments

Comments
 (0)