GraphQLWebsocketCommunicator
A test communicator for GraphQL over Websockets.
Constructor:
Create a new communicator.
Signature:
Parameters:
-
application:
Your asgi application that encapsulates the strawberry schema.
- Type
-
ASGIApplication
-
path:
the url endpoint for the schema.
- Type
-
str
-
headers:
a list of tuples to be sent as headers to the server.
- Type
-
List[Tuple[bytes, bytes]] | None
- Default
-
None
-
protocol:
currently this supports
graphql-transport-ws
only.- Type
-
str
- Default
-
GRAPHQL_TRANSPORT_WS_PROTOCOL
-
connection_params:
a dictionary of connection parameters to send to the server.
- Type
-
dict
- Default
-
ExprDict
-
kwargs:
- Type
-
Any
- Default
-
{}
Methods:
-
gql_init
Signature:
-
subscribe
Signature:
Parameters:
-
query:
- Type
-
str
-
variables:
- Type
-
Dict | None
- Default
-
None
-
-
process_errors
Reconstructs a GraphQLError from a FormattedGraphQLError.
Signature:
Parameters:
-
errors:
- Type
-
List[GraphQLFormattedError]
-
Attributes:
-
protocol:
-
connection_params: