diff --git a/netbox/netbox/graphql/views.py b/netbox/netbox/graphql/views.py index 85a01f025..46a073c93 100644 --- a/netbox/netbox/graphql/views.py +++ b/netbox/netbox/graphql/views.py @@ -14,7 +14,6 @@ class NetBoxGraphQLView(GraphQLView): """ Extends strawberry's GraphQLView to support DRF's token-based authentication. """ - graphiql_template = 'graphiql.html' @csrf_exempt def dispatch(self, request, *args, **kwargs): diff --git a/netbox/templates/graphiql.html b/netbox/templates/graphql/graphiql.html similarity index 87% rename from netbox/templates/graphiql.html rename to netbox/templates/graphql/graphiql.html index 0281012dc..f50648f1f 100644 --- a/netbox/templates/graphiql.html +++ b/netbox/templates/graphql/graphiql.html @@ -1,15 +1,8 @@ +{% load static %} {% comment %} This template derives from the strawberry-graphql project: https://github.com/strawberry-graphql/strawberry/blob/main/strawberry/static/graphiql.html {% endcomment %} - -{% load static %} @@ -112,10 +105,7 @@ add "&raw" to the end of the URL within a browser. headers["x-csrftoken"] = csrfToken; } - const subscriptionsEnabled = JSON.parse("{{ SUBSCRIPTION_ENABLED }}"); - const subscriptionUrl = subscriptionsEnabled - ? httpUrlToWebSockeUrl(fetchURL) - : null; + const subscriptionUrl = httpUrlToWebSockeUrl(fetchURL); const fetcher = GraphiQL.createFetcher({ url: fetchURL,