This release adds support for updating (or adding) the query document inside an
extension's on_request_start method.
This can be useful for implementing persisted queries. The old behavior of
returning a 400 error if no query is present in the request is still supported.
Example usage:
from strawberry.extensions import Extension
def get_doc_id(request) -> str:
"""Implement this to get the document ID using your framework's request object"""
...
def load_persisted_query(doc_id: str) -> str:
"""Implement this load a query by document ID. For example, from a database."""
...
class PersistedQuery(Extension):
def on_request_start(self):
request = self.execution_context.context.request
This release adds support for updating (or adding) the query document inside an
extension's on_request_start method.
This can be useful for implementing persisted queries. The old behavior of
returning a 400 error if no query is present in the request is still supported.
Example usage:
from strawberry.extensions import Extension
def get_doc_id(request) -> str:
"""Implement this to get the document ID using your framework's request object"""
...
def load_persisted_query(doc_id: str) -> str:
"""Implement this load a query by document ID. For example, from a database."""
...
class PersistedQuery(Extension):
def on_request_start(self):
request = self.execution_context.context.request
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps strawberry-graphql from 0.133.5 to 0.152.0.
Release notes
Sourced from strawberry-graphql's releases.
... (truncated)
Changelog
Sourced from strawberry-graphql's changelog.
... (truncated)
Commits
dca88b0
Release ๐ 0.152.0a70603b
Delay checking for query until after extensions get a chance to run (#2431)d457c2e
[pre-commit.ci] pre-commit autoupdate (#2418)10f8ba0
Release ๐ 0.151.301aef8b
Add support for FastAPI 0.89.0 (#2440)feacc0f
Release ๐ 0.151.2b65c020
Fix: copy field metadata for pydantic (#2415)9f403a8
Release ๐ 0.151.1bee7ec3
Fix enums inside generics (#2411)bffe8a1
Bump types-python-dateutil from 2.8.19.4 to 2.8.19.5 (#2408)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)