GraphQL (dagster-graphql)

Python Client

class dagster_graphql.DagsterGraphQLClient(hostname, port_number=None, transport=None, use_https=False)[source]

Official Dagster Python Client for GraphQL

Utilizes the gql library to dispatch queries over HTTP to a remote Dagster GraphQL Server

As of now, all operations on this client are synchronous.

Intended usage:

client = DagsterGraphQLClient("localhost", port_number=3000)
status = client.get_run_status(**SOME_RUN_ID**)
Parameters:
  • hostname (str) – Hostname for the Dagster GraphQL API, like localhost or dagit.dagster.YOUR_ORG_HERE.

  • port_number (Optional[int], optional) – Optional port number to connect to on the host. Defaults to None.

  • transport (Optional[Transport], optional) – A custom transport to use to connect to the GraphQL API with (e.g. for custom auth). Defaults to None.

  • use_https (bool, optional) – Whether to use https in the URL connection string for the GraphQL API. Defaults to False.

Raises:

ConnectionError – if the client cannot connect to the host.

exception dagster_graphql.DagsterGraphQLClientError(*args, body=None)[source]
class dagster_graphql.InvalidOutputErrorInfo(step_key, invalid_output_name)[source]

This class gives information about an InvalidOutputError from submitting a pipeline for execution from GraphQL.

Parameters:
  • step_key (str) – key of the step that failed

  • invalid_output_name (str) – the name of the invalid output from the given step

class dagster_graphql.ReloadRepositoryLocationInfo(status, failure_type=None, message=None)[source]

This class gives information about the result of reloading a Dagster repository location with a GraphQL mutation.

Parameters:
  • status (ReloadRepositoryLocationStatus) – The status of the reload repository location mutation

  • failure_type – (Optional[str], optional): the failure type if status == ReloadRepositoryLocationStatus.FAILURE. Can be one of ReloadNotSupported, RepositoryLocationNotFound, or RepositoryLocationLoadFailure. Defaults to None.

  • message (Optional[str], optional) – the failure message/reason if status == ReloadRepositoryLocationStatus.FAILURE. Defaults to None.

class dagster_graphql.ReloadRepositoryLocationStatus(value)[source]

This enum describes the status of a GraphQL mutation to reload a Dagster repository location

Parameters:

Enum (str) – can be either ReloadRepositoryLocationStatus.SUCCESS or ReloadRepositoryLocationStatus.FAILURE.