diff --git a/graphql_ws/django/routing.py b/graphql_ws/django/routing.py index 15a1356..d5a0c1a 100644 --- a/graphql_ws/django/routing.py +++ b/graphql_ws/django/routing.py @@ -3,6 +3,7 @@ from django.apps import apps from django.urls import path from .consumers import GraphQLSubscriptionConsumer +from .settings import graphql_ws_path if apps.is_installed("django.contrib.auth"): from channels.auth import AuthMiddlewareStack @@ -10,7 +11,7 @@ AuthMiddlewareStack = None -websocket_urlpatterns = [path("subscriptions", GraphQLSubscriptionConsumer)] +websocket_urlpatterns = [path(graphql_ws_path, GraphQLSubscriptionConsumer)] application = ProtocolTypeRouter({"websocket": URLRouter(websocket_urlpatterns)}) diff --git a/graphql_ws/django/settings.py b/graphql_ws/django/settings.py new file mode 100644 index 0000000..766f272 --- /dev/null +++ b/graphql_ws/django/settings.py @@ -0,0 +1,3 @@ +from django.conf import settings + +graphql_ws_path = getattr(settings, "GRAPHQL_WS_PATH", "subscriptions") diff --git a/graphql_ws/django/templates/graphene/graphiql.html b/graphql_ws/django/templates/graphene/graphiql.html index dce2683..526dc33 100644 --- a/graphql_ws/django/templates/graphene/graphiql.html +++ b/graphql_ws/django/templates/graphene/graphiql.html @@ -1,3 +1,4 @@ +{% load graphql_ws %}