Hi. I'm using strawberry graphql library for my project.
I'm using async view and I tried to disable graphql ide by giving a parameter like following.
`
from strawberry.django.views import AsyncGraphQLView
class MyGraphQLView(AsyncGraphQLView):
...
urlpatterns = [
path("graphql/", MyGraphQLView.as_view(schema=schema, graphql_ide=None)),
]
`
But I still see graphiql is loaded when I accessed /graphql/ via GET method.
I looked into the details and I found that graphql_ide variable remains as a default value ("graphiql") in AsyncBaseHTTPView.run method.
`
print(self.graphql_ide) # "graphiql was printed though I gave a parameter graphql_ide=None to AsyncGraphQLView.asView function.
if self.should_render_graphql_ide(request_adapter):
if self.graphql_ide:
return await self.render_graphql_ide(request)
else:
raise HTTPException(404, "Not Found")
`
And I'm using subscription. So my asgi.py file is like following.
`
urlpatterns = [re_path(r"graphql", GraphQLWSConsumer.as_asgi(schema=schema))]
gql_http_consumer = AuthMiddlewareStack(GraphQLHTTPConsumer.as_asgi(schema=schema))
gql_ws_consumer = GraphQLWSConsumer.as_asgi(schema=schema)
app = ProtocolTypeRouter(
{
"http": URLRouter(
[
re_path("^graphql", gql_http_consumer),
re_path("^", django_asgi_app),
]
),
"websocket": AuthMiddlewareStack(URLRouter(urlpatterns))
}
)
`
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too