1
- from graphql .execution .middleware import middleware_chain
2
- from graphql .execution .middleware import get_middleware_resolvers
3
- from graphql .language .parser import parse
1
+ from __future__ import print_function
2
+
4
3
from graphql .execution import MiddlewareManager , execute
4
+ from graphql .execution .middleware import (get_middleware_resolvers ,
5
+ middleware_chain )
6
+ from graphql .language .parser import parse
5
7
from graphql .type import (GraphQLArgument , GraphQLBoolean , GraphQLField ,
6
- GraphQLInt , GraphQLList , GraphQLObjectType ,
7
- GraphQLSchema , GraphQLString , GraphQLNonNull , GraphQLID )
8
+ GraphQLID , GraphQLInt , GraphQLList , GraphQLNonNull ,
9
+ GraphQLObjectType , GraphQLSchema , GraphQLString )
8
10
from promise import Promise
9
11
10
12
@@ -120,9 +122,9 @@ def __init__(self, char):
120
122
self .char = char
121
123
122
124
def resolve (self , next , * args , ** kwargs ):
123
- print (f' resolve() called for middleware { self .char } ' )
125
+ print (" resolve() called for middleware {}" . format ( self .char ) )
124
126
return next (* args , ** kwargs ).then (
125
- lambda x : print (f' then() for { self .char } ' )
127
+ lambda x : print (" then() for {}" . format ( self .char ) )
126
128
)
127
129
128
130
middlewares = [
@@ -154,4 +156,4 @@ def func(): return
154
156
155
157
def assert_stdout (capsys , expected_stdout ):
156
158
captured = capsys .readouterr ()
157
- assert captured .out == expected_stdout
159
+ assert captured .out == expected_stdout
0 commit comments