GraphQLHTTPConsumer
A consumer to provide a view for GraphQL over HTTP.
To use this, place it in your ProtocolTypeRouter for your channels project:
from strawberry.channels import GraphQLHttpRouterfrom channels.routing import ProtocolTypeRouterfrom django.core.asgi import get_asgi_application
application = ProtocolTypeRouter({ "http": URLRouter([ re_path("^graphql", GraphQLHTTPRouter(schema=schema)), re_path("^", get_asgi_application()), ]), "websocket": URLRouter([ re_path("^ws/graphql", GraphQLWebSocketRouter(schema=schema)), ]),})
Methods:
-
get_root_value
Signature:
def get_root_value(self, request: ChannelsRequest) -> RootValue | None:...Parameters:
-
request:
- Type
-
ChannelsRequest
-
-
get_context
Signature:
def get_context(self, request: ChannelsRequest, response: TemporalResponse) -> Context:...Parameters:
-
request:
- Type
-
ChannelsRequest
-
response:
- Type
-
TemporalResponse
-
-
get_sub_response
Signature:
def get_sub_response(self, request: ChannelsRequest) -> TemporalResponse:...Parameters:
-
request:
- Type
-
ChannelsRequest
-
-
render_graphql_ide
Signature:
def render_graphql_ide(self, request: ChannelsRequest) -> ChannelsResponse:...Parameters:
-
request:
- Type
-
ChannelsRequest
-
Attributes:
-
allow_queries_via_get:
- Type
-
bool
-
request_adapter_class: