GraphQL integration for AllianceAuth
Project description
allianceauth-graphql
GraphQL integration for AllianceAuth
Free software: GNU General Public License v3
Usage
This version is still in pre-alpha, as of v0.1.1 it does nothing.
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_APPS
in the local.py settings file:'allianceauth_graphql', 'graphene_django',
-
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_EXPIRATION_DELTA": timedelta(days=1), }
-
Edit your projects url.py file:
It should looks something like this
from django.conf.urls import include, url from allianceauth import urls urlpatterns = [ url(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, url from allianceauth import urls from allianceauth_graphql import urls as aa_gql_urls urlpatterns = [ url(r'', include(urls)), url(r'graphql/', include(aa_gql_urls)), ] handler500 = 'allianceauth.views.Generic500Redirect' handler404 = 'allianceauth.views.Generic404Redirect' handler403 = 'allianceauth.views.Generic403Redirect' handler400 = 'allianceauth.views.Generic400Redirect'
-
Restart AllianceAuth.
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 |
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
v0.2.0
* Working login with django-graphql-jwt
v0.1.1 (2022-04-02)
* Working /graphql/ endpoint and updated requirements.
v0.1.0 (2022-03-18)
* First release on PyPI.
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
Hashes for allianceauth_graphql-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f1fdb43ba93aa85dab235ff564eeffe19b6153392d98af876282e46ba3526c1 |
|
MD5 | 5ea17475fcf66109387636e76f5e41f0 |
|
BLAKE2b-256 | 43ca453b9302d9cf5ee50ce2c4ba3098393cd4fa3e0d074b1c64993633168b9e |
Hashes for allianceauth_graphql-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ddf4b9b55ce6fb3309867c03ec42e0420e2ca3897fc8855e238b3a4e08d177b |
|
MD5 | 68ab5eafb17d904d87ab7115dd2ee596 |
|
BLAKE2b-256 | dee1622f960122722231801f0ae93fbbd2584356453cffb62eaf5743e4834c52 |