File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ def make_scalar_def(definition):
234
234
def make_input_object_def (definition ):
235
235
return GraphQLInputObjectType (
236
236
name = definition .name .value ,
237
- fields = make_input_values (definition .fields , GraphQLInputObjectField )
237
+ fields = lambda : make_input_values (definition .fields , GraphQLInputObjectField )
238
238
)
239
239
240
240
_schema_def_handlers = {
Original file line number Diff line number Diff line change @@ -411,6 +411,25 @@ def test_input_types_are_read():
411
411
assert input_type .fields ["id" ].type == GraphQLInt
412
412
413
413
414
+ def test_input_types_can_be_recursive ():
415
+ schema = build_ast_schema (parse ("""
416
+ schema {
417
+ query: Query
418
+ }
419
+
420
+ type Query {
421
+ field(input: Input): Int
422
+ }
423
+
424
+ input Input {
425
+ id: Input
426
+ }
427
+ """ ))
428
+
429
+ input_type = schema .get_type ("Input" )
430
+ assert input_type .fields ["id" ].type == input_type
431
+
432
+
414
433
def test_simple_argument_field_with_default ():
415
434
body = '''
416
435
schema {
You can’t perform that action at this time.
0 commit comments