Client
ValidioConfig | None
Type:
ValidioConfigstr
dict[str, str]
object
A GraphQL client with sensible defaults for Validio.
NOTE! The client used in the examples below is in beta and breaking changes may happen.
It will be created by reading the Validio configuration just like the CLI tool and ensure the correct headers are passed.
If no ValidioConfig is passed when constructing the client, it will fallback to first look for required environment variables:
- VALIDIO_ENDPOINT
- VALIDIO_ACCESS_KEY
- VALIDIO_SECRET_ACCESS_KEY
execute()
str
required
Any
Execute a GraphQL request.
-
Parameters:
- query – The query to be executed
- kwargs – Arguments matching the GraphQL client e.g. variable_values and operation_name.
- Returns: The API response
Session
AsyncClientSession
required
int | float | None
object
A session to perform multiple requests.
NOTE! The client used in the examples below is in beta and breaking changes may happen.
A session will support running multiple requests with the same client. It will ensure the connection is open and not closed until the session goes out of scope.
execute()
str
required
Any
Execute a query in the session.
-
Parameters:
- query – The query to be executed
- kwargs – Arguments matching the GraphQL client e.g. variable_values and operation_name.
- Returns: The API response