@@ -59,9 +59,9 @@ def subscribe(*args, **kwargs):
5959def execute (
6060 schema , # type: GraphQLSchema
6161 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]
6565 operation_name = None , # type: Optional[str]
6666 executor = None , # type: Any
6767 return_promise = False , # type: bool
@@ -71,27 +71,27 @@ def execute(
7171):
7272 # type: (...) -> Union[ExecutionResult, Promise[ExecutionResult]]
7373
74- if root is None and "root_value " in options :
74+ if root_value is None and "root " in options :
7575 warnings .warn (
76- "root_value has been deprecated. Please use root=... instead." ,
76+ "The 'root' alias has been deprecated. Please use 'root_value' instead." ,
7777 category = DeprecationWarning ,
7878 stacklevel = 2 ,
7979 )
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 :
8282 warnings .warn (
83- "context_value has been deprecated. Please use context=... instead." ,
83+ "The 'context' alias has been deprecated. Please use 'context_value' instead." ,
8484 category = DeprecationWarning ,
8585 stacklevel = 2 ,
8686 )
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 :
8989 warnings .warn (
90- "variable_values has been deprecated. Please use variables=... instead." ,
90+ "The 'variables' alias has been deprecated. Please use 'variable_values' instead." ,
9191 category = DeprecationWarning ,
9292 stacklevel = 2 ,
9393 )
94- variables = options ["variable_values " ]
94+ variable_values = options ["variables " ]
9595 assert schema , "Must provide schema"
9696 assert isinstance (schema , GraphQLSchema ), (
9797 "Schema must be an instance of GraphQLSchema. Also ensure that there are "
@@ -113,9 +113,9 @@ def execute(
113113 exe_context = ExecutionContext (
114114 schema ,
115115 document_ast ,
116- root ,
117- context ,
118- variables or {},
116+ root_value ,
117+ context_value ,
118+ variable_values or {},
119119 operation_name ,
120120 executor ,
121121 middleware ,
@@ -124,7 +124,7 @@ def execute(
124124
125125 def promise_executor (v ):
126126 # 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 )
128128
129129 def on_rejected (error ):
130130 # type: (Exception) -> None
0 commit comments