Skip to main content
A client used to send GraphQL requests with sensible defaults for Validio. The client simply wraps a [gql.client.Client] and works the same way regarding sessions to support safe use of the client in parallel. More details can be found at https://gql.readthedocs.io/en/latest/advanced/async_advanced_usage.html

Client

Parameters
ValidioConfig | None
str
dict[str, str]
Bases: 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
If not all of them are found, it will look for a configuration file. It will first look in the path set in VALIDIO_CONFIG_PATH and if that one is empty it will look in the default OS dependant system directory.

execute()

Parameters
str
required
Returns: 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

Parameters
AsyncClientSession
required
int | float | None
Bases: 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()

Parameters
str
required
Returns: 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