Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ gql_view(request) # <-- the instance is callable and expects a `aiohttp.web.Req
- `encoder`: the encoder to use for responses (sensibly defaults to `graphql_server.json_encode`)
- `error_formatter`: the error formatter to use for responses (sensibly defaults to `graphql_server.default_format_error`)
- `enable_async`: whether `async` mode will be enabled.
- `backend`: the backend to be used to create `GraphQLDocument` from a string (sensibly defaults to `graphql.backend.core.GraphQLCoreBackend`).


## Testing
Expand Down
3 changes: 3 additions & 0 deletions aiohttp_graphql/graphqlview.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def __init__(
encoder=None,
error_formatter=None,
enable_async=True,
backend=None,
):
# pylint: disable=too-many-arguments
# pylint: disable=too-many-locals
Expand All @@ -58,6 +59,7 @@ def __init__(
self.executor,
AsyncioExecutor,
)
self.backend = backend
assert isinstance(self.schema, GraphQLSchema), \
'A Schema is required to be provided to GraphQLView.'

Expand Down Expand Up @@ -141,6 +143,7 @@ async def __call__(self, request):
context_value=self.get_context(request),
middleware=self.middleware,
executor=self.executor,
backend=self.backend,
)

awaited_execution_results = await Promise.all(execution_results)
Expand Down