Skip to main content

No project description provided

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

strawberry_persisted_queries-1.0.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page