Skip to main content

Offline-compatible GraphiQL for Graphene-Django

Project description

Graphene-Django-GraphiQL-Static provides an offline-compatible GraphiQL web UI for Graphene-Django projects. It ensures uninterrupted GraphQL query exploration by serving all necessary assets locally, making it reliable even during internet outages.

Documentation

The full documentation is at https://github.com/prashantz7242/graphene-django-graphiql-static#readme.

Quickstart

Install graphene-django-graphiql-static:

pip install graphene-django-graphiql-static

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    # Other installed apps
    'graphene_django_graphiql_static',
)

Add graphene-django-graphiql-static’s URL Patterns

When using graphene-django-graphiql-static, you should import the GraphiQLOfflineView provided by this package instead of the regular GraphQLView from graphene-django.

Do Not Import GraphQLView from graphene_django.views:

# Incorrect import
from graphene_django.views import GraphQLView

Instead, use the GraphiQLOfflineView provided by graphene-django-graphiql-static to enable offline-compatible GraphiQL:

# Correct import
from graphene_django_graphiql_static.views import GraphiQLOfflineView

Below is an example of how to define your urlpatterns using GraphiQLOfflineView:

from django.urls import path
from django.views.decorators.csrf import csrf_exempt
from graphene_django_graphiql_static.views import GraphiQLOfflineView

urlpatterns = [
    # Other installed apps
    path(
        "graphql/",
        csrf_exempt(
            GraphiQLOfflineView.as_view(schema=gq_schema, graphiql=settings.DEBUG)
        ),
        name="graphql",
    ),
]

This ensures that your project uses the offline-compatible GraphiQL UI provided by graphene-django-graphiql-static and serves all necessary assets locally.

Features

  1. Offline-Compatible GraphiQL UI Provides a fully functional GraphiQL web interface for exploring GraphQL queries and mutations, even when the internet connection is unavailable.

  2. Static Asset Hosting Serves all required assets (CSS, JavaScript) locally through Django’s static files system, ensuring reliability and performance.

  3. Easy Integration with Graphene-Django Designed to seamlessly integrate with Graphene-Django projects, requiring minimal configuration.

  4. Improved Developer Experience Offers a consistent and uninterrupted development workflow for working with GraphQL APIs, independent of external asset CDNs.

  5. Customizable and Extendable Fully customizable to adapt to project-specific requirements while maintaining compatibility with Django’s template and static systems.

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

graphene_django_graphiql_static-0.8.tar.gz (635.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphene_django_graphiql_static-0.8-py3-none-any.whl (637.9 kB view details)

Uploaded Python 3

File details

Details for the file graphene_django_graphiql_static-0.8.tar.gz.

File metadata

File hashes

Hashes for graphene_django_graphiql_static-0.8.tar.gz
Algorithm Hash digest
SHA256 ab103b07fac3c91b509849563c8dcdb64f02f915ac97436fa0e0f9bb2df6e7f4
MD5 4c24f2ef8b765a668d4bec9d93612bf7
BLAKE2b-256 799151bdd8f07b10bee48980d86e97e60658a9b46d8fe2430f7930f45b69e958

See more details on using hashes here.

File details

Details for the file graphene_django_graphiql_static-0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for graphene_django_graphiql_static-0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 f5a8669485fdf2ef292ad024867093d057c63d165f52a64d58f4313fd6b5e3c5
MD5 19f1598ae139dfa3b98130a4d1495002
BLAKE2b-256 720576ee6b3c4c299fb4ed9a3c3a184e44178672c42d8adf1d0d1ea7fb6daf70

See more details on using hashes here.

Supported by

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