allianceauth-graphql
GraphQL integration for AllianceAuth
Free software: GNU General Public License v3
This version is in beta, please open an issue if you face any bug.
Compatibility
Versions >=0.16 are only compatible with AllianceAuth v3.
Setup
The following is assuming you have a functioning AllianceAuth installation.
Install plugin
-
pip install allianceauth-graphql. -
Add the following apps to the bottom of your
INSTALLED_APPSin the local.py settings file:'allianceauth_graphql', 'graphene_django', "graphql_jwt.refresh_token.apps.RefreshTokenConfig",
-
Add the following settings to your local.py file:
from datetime import timedelta # ... GRAPHENE = { 'SCHEMA': 'allianceauth_graphql.schema.schema', "MIDDLEWARE": [ "graphql_jwt.middleware.JSONWebTokenMiddleware", ], } AUTHENTICATION_BACKENDS += [ "graphql_jwt.backends.JSONWebTokenBackend", ] GRAPHQL_JWT = { "JWT_VERIFY_EXPIRATION": True, "JWT_LONG_RUNNING_REFRESH_TOKEN": True, "JWT_EXPIRATION_DELTA": timedelta(days=1), "JWT_REFRESH_EXPIRATION_DELTA": timedelta(days=7), }
Feel free to edit the expiration limits of your tokens.
-
Edit your projects url.py file:
It should looks something like this
from django.conf.urls import include from allianceauth import urls from django.urls import re_path urlpatterns = [ re_path(r'', include(urls)), ] handler500 = 'allianceauth.views.Generic500Redirect' handler404 = 'allianceauth.views.Generic404Redirect' handler403 = 'allianceauth.views.Generic403Redirect' handler400 = 'allianceauth.views.Generic400Redirect'
After the edit:
from django.conf.urls import include from allianceauth import urls from allianceauth_graphql import urls as aa_gql_urls from django.urls import re_path urlpatterns = [ re_path(r'', include(urls)), re_path(r'graphql/', include(aa_gql_urls)), ] handler500 = 'allianceauth.views.Generic500Redirect' handler404 = 'allianceauth.views.Generic404Redirect' handler403 = 'allianceauth.views.Generic403Redirect' handler400 = 'allianceauth.views.Generic400Redirect'
-
Run migrations.
-
If you have
SHOW_GRAPHIQLsetting set toTrue(see below), run collectstatics -
Restart AllianceAuth.
Community Creations Integration
Currently the package supports the integration with the following community packages:
- allianceauth-pve: v1.11.x
Be sure to check if you have the right versions of these package or the GraphQL will not have the same behaviour as the apps.
Settings
| Setting | Default | Description |
|---|---|---|
| SHOW_GRAPHIQL | True |
Shows the graphiql UI in the browser |
| GRAPHQL_LOGIN_SCOPES | ['publicData'] |
Tokens needed. Unlike AllianceAuth pages, you need to login with the scopes you'll use, otherwise you won't be able to perform some queries |
| REDIRECT_SITE | No default | The URL domain for redirecting after email verification. It has to have the protocol and not the slash at the end: http(s)://<yoursite> |
| REDIRECT_PATH | /registration/callback/ |
Path to append to REDIRECT_SITE for building the redirect URL |
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Metadata
Release files for allianceauth-graphql 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| allianceauth_graphql-1.3.0.tar.gz | 47.3 kB | Without provenance | Details for allianceauth_graphql-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| allianceauth_graphql-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for allianceauth_graphql-1.3.0-py3-none-any.whl |
Total release size: 123.6 kB
Release files / allianceauth_graphql-1.3.0.tar.gz
| Download URL | allianceauth_graphql-1.3.0.tar.gz |
|---|---|
| Size | 47.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a09a43758ed87cb215e443cfb4caa97a6edfd65e465f27c52cb1784e2338e096
|
|
BLAKE2b-256 checksum How to use checksums |
0480e31075e7505a9a8314e9ff412926af8310e4994cbcb854c8b126c622615f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Release files / allianceauth_graphql-1.3.0-py3-none-any.whl
| Download URL | allianceauth_graphql-1.3.0-py3-none-any.whl |
|---|---|
| Size | 76.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b6a07191d39b835512262b6f5a8b26d5ff78d49f74551b8b9946aed6b0857f5
|
|
BLAKE2b-256 checksum How to use checksums |
a4fb5b9af59bb0ae1a6f486587f1d3769e3dc52f87071a2ba86b85d1d4e5d17a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.0.0 CPython/3.12.2
|
Security for allianceauth-graphql 1.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.