File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ def schema(self):
77
77
self ,
78
78
query = self .T (self .query ),
79
79
mutation = self .T (self .mutation ),
80
+ types = [self .T (_type ) for _type in list (self ._types_names .values ())],
80
81
subscription = self .T (self .subscription ))
81
82
82
83
def register (self , object_type , force = False ):
Original file line number Diff line number Diff line change @@ -132,6 +132,21 @@ class MyType(ObjectType):
132
132
assert schema .get_type ('MyType' ) == MyType
133
133
134
134
135
+ def test_schema_register_interfaces ():
136
+ class Query (ObjectType ):
137
+ f = Field (Character )
138
+
139
+ def resolve_f (self , args , info ):
140
+ return Human ()
141
+
142
+ schema = Schema (query = Query )
143
+
144
+ schema .register (Human )
145
+
146
+ result = schema .execute ('{ f { name } }' )
147
+ assert not result .errors
148
+
149
+
135
150
def test_schema_register_no_query_type ():
136
151
schema = Schema (name = 'My own schema' )
137
152
You can’t perform that action at this time.
0 commit comments