Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def execute_query(self, environ: dict, data: dict) -> GraphQLResult:
return graphql_sync(
self.schema,
data,
context_value=self.get_context_for_request(environ),
root_value=self.root_value,
debug=self.debug,
logger=self.logger,
error_formatter=self.error_formatter,
)
def execute_query(self, request: HttpRequest, data: dict) -> GraphQLResult:
if callable(self.context_value):
context_value = self.context_value(request) # pylint: disable=not-callable
else:
context_value = self.context_value or request
return graphql_sync(
cast(GraphQLSchema, self.schema),
data,
context_value=context_value,
root_value=self.root_value,
debug=settings.DEBUG,
logger=self.logger,
validation_rules=self.validation_rules,
error_formatter=self.error_formatter or format_error,
middleware=self.middleware,
)
def execute_query(self, environ: dict, data: dict) -> GraphQLResult:
context_value = self.get_context_for_request(environ)
extensions = self.get_extensions_for_request(environ, context_value)
middleware = self.get_middleware_for_request(environ, context_value)
return graphql_sync(
self.schema,
data,
context_value=context_value,
root_value=self.root_value,
debug=self.debug,
logger=self.logger,
error_formatter=self.error_formatter,
extensions=extensions,
middleware=middleware,
)