@@ -27,7 +27,8 @@ class ExecutionContext(object):
2727 Namely, schema of the type system that is currently executing,
2828 and the fragments defined in the query document"""
2929
30- __slots__ = 'schema' , 'fragments' , 'root' , 'operation' , 'variables' , 'errors' , 'request_context'
30+ __slots__ = 'schema' , 'fragments' , 'root' , 'operation' , 'variables' , 'errors' , 'request_context' , \
31+ 'argument_values_cache'
3132
3233 def __init__ (self , schema , root , document_ast , operation_name , args , request_context ):
3334 """Constructs a ExecutionContext object from the arguments passed
@@ -70,6 +71,17 @@ def __init__(self, schema, root, document_ast, operation_name, args, request_con
7071 self .variables = variables
7172 self .errors = errors
7273 self .request_context = request_context
74+ self .argument_values_cache = {}
75+
76+ def get_argument_values (self , field_def , field_ast ):
77+ k = field_def , field_ast
78+ result = self .argument_values_cache .get (k )
79+
80+ if not result :
81+ result = self .argument_values_cache [k ] = get_argument_values (field_def .args , field_ast .arguments ,
82+ self .variables )
83+
84+ return result
7385
7486
7587class ExecutionResult (object ):
0 commit comments