@@ -27,7 +27,8 @@ class ExecutionContext(object):
27
27
Namely, schema of the type system that is currently executing,
28
28
and the fragments defined in the query document"""
29
29
30
- __slots__ = 'schema' , 'fragments' , 'root' , 'operation' , 'variables' , 'errors' , 'request_context'
30
+ __slots__ = 'schema' , 'fragments' , 'root' , 'operation' , 'variables' , 'errors' , 'request_context' , \
31
+ 'argument_values_cache'
31
32
32
33
def __init__ (self , schema , root , document_ast , operation_name , args , request_context ):
33
34
"""Constructs a ExecutionContext object from the arguments passed
@@ -70,6 +71,17 @@ def __init__(self, schema, root, document_ast, operation_name, args, request_con
70
71
self .variables = variables
71
72
self .errors = errors
72
73
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
73
85
74
86
75
87
class ExecutionResult (object ):
0 commit comments