Data Containers¶
GraphQLRequest¶
- class aiographql.client.GraphQLRequest(query: str, operation: dataclasses.InitVar[str | None] = None, variables: dict[str, Any]=<factory>, validate: bool = True, headers: dict[str, str]=<factory>, codec: GraphQLCodec | None = None) None¶
GraphQL Request object that can be reused or used to store multiple named queries with default operationName`, *variables and header to use.
- Parameters:
query (
str) – GraphQL query string.operation (
InitVar) – Optional name of operation to use from the query.variables (
dict[str,Any]) – Variable dictionary pass with the query to the server.validate (
bool) – If True, the request query is validated against the latest available schema from the server.headers (
dict[str,str]) – Headers to use, in addition to client default headers when making the HTTP request.codec (
GraphQLCodec|None)
GraphQLResponse¶
- class aiographql.client.GraphQLResponse(request: GraphQLRequest | str, headers: dataclasses.InitVar[dict[str, str] | None]=None, operation: dataclasses.InitVar[str | None] = None, variables: dataclasses.InitVar[dict[str, Any] | None]=None, codec: dataclasses.InitVar[GraphQLCodec | None] = None, json: dict[str, Any]=<factory>) None¶
GraphQL Response object wrapping response data and any errors. This object also contains the a copy of the
GraphQLRequestthat produced this response.- Parameters:
request (GraphQLRequest | str)
headers (dataclasses.InitVar[dict[str, str] | None])
operation (dataclasses.InitVar[str | None])
variables (dataclasses.InitVar[dict[str, Any] | None])
codec (dataclasses.InitVar[GraphQLCodec | None])
json (dict[str, Any])
- property errors: list[GraphQLError]¶
A list of
GraphQLErrorobjects if server responded with query errors.
GraphQLSubscriptionEvent¶
- class aiographql.client.GraphQLSubscriptionEvent(request: GraphQLRequest | str, headers: dataclasses.InitVar[dict[str, str] | None]=None, operation: dataclasses.InitVar[str | None] = None, variables: dataclasses.InitVar[dict[str, typing.Any] | None]=None, codec: dataclasses.InitVar[aiographql.client.codec.GraphQLCodec | None] = None, json: dict[str, ~typing.Any]=<factory>, subscription_id: str | None = None) None¶
GraphQL subscription event wrapping the payload received from the server.
- Parameters:
- property type: GraphQLSubscriptionEventType | None¶
The type of event (
GraphQLSubscriptionEventType).
- property payload: GraphQLResponse | str | None¶
The id of the subscription that generated this event.
GraphQLCodec¶
- class aiographql.client.GraphQLCodec(*args, **kwargs)¶