GraphQLView
Class based view to handle GraphQL HTTP Requests.
Args: schema: strawberry.Schema graphiql: bool, default is True allow_queries_via_get: bool, default is True
Returns: None
Example: app.add_route( GraphQLView.as_view(schema=schema, graphiql=True), “/graphql” )
Constructor:
Signature:
Parameters:
-
schema:
- Type
-
BaseSchema
-
graphiql:
- Type
-
bool | None
- Default
-
None
-
graphql_ide:
- Type
-
GraphQL_IDE | None
- Default
-
'graphiql'
-
allow_queries_via_get:
- Type
-
bool
- Default
-
True
-
json_encoder:
- Type
-
Type[json.JSONEncoder] | None
- Default
-
None
-
json_dumps_params:
- Type
-
Dict[str, Any] | None
- Default
-
None
Methods:
-
get_root_value
Signature:
Parameters:
-
request:
- Type
-
Request
-
-
get_context
Signature:
Parameters:
-
request:
- Type
-
Request
-
response:
- Type
-
TemporalResponse
-
-
render_graphql_ide
Signature:
Parameters:
-
request:
- Type
-
Request
-
-
get_sub_response
Signature:
Parameters:
-
request:
- Type
-
Request
-
-
create_response
Signature:
Parameters:
-
response_data:
- Type
-
GraphQLHTTPResponse
-
sub_response:
- Type
-
TemporalResponse
-
-
post
Signature:
Parameters:
-
request:
- Type
-
Request
-
-
get
Signature:
Parameters:
-
request:
- Type
-
Request
-
Attributes:
-
allow_queries_via_get:
-
request_adapter_class:
-
schema:
-
json_encoder:
-
json_dumps_params:
-
graphql_ide: