File tree Expand file tree Collapse file tree 1 file changed +18
-14
lines changed
Expand file tree Collapse file tree 1 file changed +18
-14
lines changed Original file line number Diff line number Diff line change 1212 GraphQLSchema ,
1313 GraphQLString ,
1414)
15+ from graphql .utilities import build_schema
1516
1617sync_error = RuntimeError ("sync" )
1718sync_non_null_error = RuntimeError ("syncNonNull" )
@@ -73,22 +74,25 @@ async def promiseNonNullNest(self, _info):
7374 return NullingData ()
7475
7576
76- DataType = GraphQLObjectType (
77- "DataType" ,
78- lambda : {
79- "sync" : GraphQLField (GraphQLString ),
80- "syncNonNull" : GraphQLField (GraphQLNonNull (GraphQLString )),
81- "promise" : GraphQLField (GraphQLString ),
82- "promiseNonNull" : GraphQLField (GraphQLNonNull (GraphQLString )),
83- "syncNest" : GraphQLField (DataType ),
84- "syncNonNullNest" : GraphQLField (GraphQLNonNull (DataType )),
85- "promiseNest" : GraphQLField (DataType ),
86- "promiseNonNullNest" : GraphQLField (GraphQLNonNull (DataType )),
87- },
77+ schema = build_schema (
78+ """
79+ type DataType {
80+ sync: String
81+ syncNonNull: String!
82+ promise: String
83+ promiseNonNull: String!
84+ syncNest: DataType
85+ syncNonNullNest: DataType!
86+ promiseNest: DataType
87+ promiseNonNullNest: DataType!
88+ }
89+
90+ schema {
91+ query: DataType
92+ }
93+ """
8894)
8995
90- schema = GraphQLSchema (DataType )
91-
9296
9397def execute_query (query , root_value ):
9498 return execute (schema , parse (query ), root_value )
You can’t perform that action at this time.
0 commit comments