How to use the ariadne.graphql.graphql_sync function in ariadne

To help you get started, we’ve selected a few ariadne examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mirumee / ariadne / ariadne / wsgi.py View on Github external
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,
        )
github mirumee / ariadne / ariadne / contrib / django / views.py View on Github external
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,
        )
github mirumee / ariadne / ariadne / wsgi.py View on Github external
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,
        )