
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
allianceauth-graphql
Advanced tools
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.
Versions >=0.16
are only compatible with AllianceAuth v3.
The following is assuming you have a functioning AllianceAuth installation.
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',
"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_GRAPHIQL
setting set to True
(see below), run collectstatics
Restart AllianceAuth.
Currently the package supports the integration with the following community packages:
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.
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 |
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
FAQs
GraphQL integration for AllianceAuth
We found that allianceauth-graphql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.