BaseGraphQLTransportWSHandler
Constructor:
Signature:
def __init__( self, schema: BaseSchema, debug: bool, connection_init_wait_timeout: timedelta,) -> None: ...
Parameters:
-
schema:
- Type
-
BaseSchema
-
debug:
- Type
-
bool
-
connection_init_wait_timeout:
- Type
-
timedelta
Methods:
-
get_context
Return the operations context.
Signature:
def get_context(self) -> Any:... -
get_root_value
Return the schemas root value.
Signature:
def get_root_value(self) -> Any:... -
send_json
Send the data JSON encoded to the WebSocket client.
Signature:
def send_json(self, data: dict) -> None:...Parameters:
-
data:
- Type
-
dict
-
-
close
Close the WebSocket with the passed code and reason.
Signature:
def close(self, code: int, reason: str) -> None:...Parameters:
-
code:
- Type
-
int
-
reason:
- Type
-
str
-
-
handle_request
Handle the request this instance was created for.
Signature:
def handle_request(self) -> Any:... -
handle
Signature:
def handle(self) -> Any:... -
shutdown
Signature:
def shutdown(self) -> None:... -
on_request_accepted
Signature:
def on_request_accepted(self) -> None:... -
handle_connection_init_timeout
Signature:
def handle_connection_init_timeout(self) -> None:... -
handle_task_exception
Signature:
def handle_task_exception(self, error: Exception) -> None:...Parameters:
-
error:
- Type
-
Exception
-
-
handle_message
Signature:
def handle_message(self, message: dict) -> None:...Parameters:
-
message:
- Type
-
dict
-
-
handle_connection_init
Signature:
def handle_connection_init(self, message: ConnectionInitMessage) -> None:...Parameters:
-
message:
- Type
-
ConnectionInitMessage
-
-
handle_ping
Signature:
def handle_ping(self, message: PingMessage) -> None:...Parameters:
-
message:
- Type
-
PingMessage
-
-
handle_pong
Signature:
def handle_pong(self, message: PongMessage) -> None:...Parameters:
-
message:
- Type
-
PongMessage
-
-
handle_subscribe
Signature:
def handle_subscribe(self, message: SubscribeMessage) -> None:...Parameters:
-
message:
- Type
-
SubscribeMessage
-
-
operation_task
The operation task’s top level method. Cleans-up and de-registers the operation once it is done.
Signature:
def operation_task(self, result_source: AsyncGenerator, operation: Operation) -> None:...Parameters:
-
result_source:
- Type
-
AsyncGenerator
-
operation:
- Type
-
Operation
-
-
handle_async_results
Signature:
def handle_async_results(self, result_source: AsyncGenerator, operation: Operation) -> None:...Parameters:
-
result_source:
- Type
-
AsyncGenerator
-
operation:
- Type
-
Operation
-
-
forget_id
Signature:
def forget_id(self, id: str) -> None:...Parameters:
-
id:
- Type
-
str
-
-
handle_complete
Signature:
def handle_complete(self, message: CompleteMessage) -> None:...Parameters:
-
message:
- Type
-
CompleteMessage
-
-
handle_invalid_message
Signature:
def handle_invalid_message(self, error_message: str) -> None:...Parameters:
-
error_message:
- Type
-
str
-
-
send_message
Signature:
def send_message(self, message: GraphQLTransportMessage) -> None:...Parameters:
-
message:
- Type
-
GraphQLTransportMessage
-
-
cleanup_operation
Signature:
def cleanup_operation(self, operation_id: str) -> None:...Parameters:
-
operation_id:
- Type
-
str
-
-
reap_completed_tasks
Await tasks that have completed.
Signature:
def reap_completed_tasks(self) -> None:...
Attributes:
-
task_logger:
- Type
-
logging.Logger
-
schema:
-
debug:
-
connection_init_wait_timeout:
-
connection_init_timeout_task:
- Type
-
asyncio.Task | None
-
connection_init_received:
-
connection_acknowledged:
-
connection_timed_out:
-
operations:
- Type
-
Dict[str, Operation]
-
completed_tasks:
- Type
-
List[asyncio.Task]
-
connection_params:
- Type
-
Dict[str, Any] | None