@@ -59,9 +59,9 @@ def subscribe(*args, **kwargs):
59
59
def execute (
60
60
schema , # type: GraphQLSchema
61
61
document_ast , # type: Document
62
- root = None , # type: Any
63
- context = None , # type: Optional[Any]
64
- variables = None , # type: Optional[Any]
62
+ root_value = None , # type: Any
63
+ context_value = None , # type: Optional[Any]
64
+ variable_values = None , # type: Optional[Any]
65
65
operation_name = None , # type: Optional[str]
66
66
executor = None , # type: Any
67
67
return_promise = False , # type: bool
@@ -71,27 +71,27 @@ def execute(
71
71
):
72
72
# type: (...) -> Union[ExecutionResult, Promise[ExecutionResult]]
73
73
74
- if root is None and "root_value " in options :
74
+ if root_value is None and "root " in options :
75
75
warnings .warn (
76
- "root_value has been deprecated. Please use root=... instead." ,
76
+ "The 'root' alias has been deprecated. Please use 'root_value' instead." ,
77
77
category = DeprecationWarning ,
78
78
stacklevel = 2 ,
79
79
)
80
- root = options ["root_value " ]
81
- if context is None and "context_value " in options :
80
+ root_value = options ["root " ]
81
+ if context_value is None and "context " in options :
82
82
warnings .warn (
83
- "context_value has been deprecated. Please use context=... instead." ,
83
+ "The 'context' alias has been deprecated. Please use 'context_value' instead." ,
84
84
category = DeprecationWarning ,
85
85
stacklevel = 2 ,
86
86
)
87
- context = options ["context_value " ]
88
- if variables is None and "variable_values " in options :
87
+ context_value = options ["context " ]
88
+ if variable_values is None and "variables " in options :
89
89
warnings .warn (
90
- "variable_values has been deprecated. Please use variables=... instead." ,
90
+ "The 'variables' alias has been deprecated. Please use 'variable_values' instead." ,
91
91
category = DeprecationWarning ,
92
92
stacklevel = 2 ,
93
93
)
94
- variables = options ["variable_values " ]
94
+ variable_values = options ["variables " ]
95
95
assert schema , "Must provide schema"
96
96
assert isinstance (schema , GraphQLSchema ), (
97
97
"Schema must be an instance of GraphQLSchema. Also ensure that there are "
@@ -113,9 +113,9 @@ def execute(
113
113
exe_context = ExecutionContext (
114
114
schema ,
115
115
document_ast ,
116
- root ,
117
- context ,
118
- variables or {},
116
+ root_value ,
117
+ context_value ,
118
+ variable_values or {},
119
119
operation_name ,
120
120
executor ,
121
121
middleware ,
@@ -124,7 +124,7 @@ def execute(
124
124
125
125
def promise_executor (v ):
126
126
# type: (Optional[Any]) -> Union[Dict, Promise[Dict], Observable]
127
- return execute_operation (exe_context , exe_context .operation , root )
127
+ return execute_operation (exe_context , exe_context .operation , root_value )
128
128
129
129
def on_rejected (error ):
130
130
# type: (Exception) -> None
0 commit comments