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
Offline-Compatible GraphiQL UI Provides a fully functional GraphiQL web interface for exploring GraphQL queries and mutations, even when the internet connection is unavailable.
Static Asset Hosting Serves all required assets (CSS, JavaScript) locally through Django’s static files system, ensuring reliability and performance.
Easy Integration with Graphene-Django Designed to seamlessly integrate with Graphene-Django projects, requiring minimal configuration.
Improved Developer Experience Offers a consistent and uninterrupted development workflow for working with GraphQL APIs, independent of external asset CDNs.
Customizable and Extendable Fully customizable to adapt to project-specific requirements while maintaining compatibility with Django’s template and static systems.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graphene_django_graphiql_static-0.8.tar.gz.
File metadata
- Download URL: graphene_django_graphiql_static-0.8.tar.gz
- Upload date:
- Size: 635.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab103b07fac3c91b509849563c8dcdb64f02f915ac97436fa0e0f9bb2df6e7f4
|
|
| MD5 |
4c24f2ef8b765a668d4bec9d93612bf7
|
|
| BLAKE2b-256 |
799151bdd8f07b10bee48980d86e97e60658a9b46d8fe2430f7930f45b69e958
|
File details
Details for the file graphene_django_graphiql_static-0.8-py3-none-any.whl.
File metadata
- Download URL: graphene_django_graphiql_static-0.8-py3-none-any.whl
- Upload date:
- Size: 637.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5a8669485fdf2ef292ad024867093d057c63d165f52a64d58f4313fd6b5e3c5
|
|
| MD5 |
19f1598ae139dfa3b98130a4d1495002
|
|
| BLAKE2b-256 |
720576ee6b3c4c299fb4ed9a3c3a184e44178672c42d8adf1d0d1ea7fb6daf70
|