Apollo-compatible persisted queries for Strawberry
Project description
🍓Strawberry Persisted Queries
Apollo-compatible persisted queries for Strawberry.
Usage
Add PersistedQueriesExtension
to your extensions.
import strawberry
from strawberry_persisted_queries import PersistedQueriesExtension
schema = strawberry.Schema(
query=Query,
extensions=[
PersistedQueriesExtension(),
],
)
Django
For Django, a Django cache backend is available.
from strawberry_persisted_queries.django_cache import DjangoPersistedQueryCache
PersistedQueriesExtension(cache_backend=DjangoPersistedQueryCache())
Safelisted Queries
DictSafelist
can be used to require persisted queries to already be saved.
This can be used with a build tool to ensure only queries used by your app are available.
from strawberry_persisted_queries.safelisting import DictSafelist
PersistedQueriesExtension(safelist=DictSafelist({
'sha256Hash': 'query {...}',
}))
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for strawberry_persisted_queries-1.0.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcf95e102b4ca1c17c06620732c1e3a0f9af4b624d455404d50ff267448fdd03 |
|
MD5 | 2abc66e33812407fb6c206119fcc726f |
|
BLAKE2b-256 | d6e7f1d3b87145b16b1660c313c68d24aada202d79106582b3bfca9a0a70dc3d |
Close
Hashes for strawberry_persisted_queries-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 171f2a3ac06a715bd1611b0150f724aeba3788132ef1604a10e3bc9bdbe60cc8 |
|
MD5 | 3e752514e370a8f688125d4a5e7591ea |
|
BLAKE2b-256 | 0f4f9170ed1ce85a1ddea9bc714859529ee9c575ff6859db407ce4a7a1e317d8 |