is there an example somewhere of pointing the pyth...
# ask-community
z
is there an example somewhere of pointing the python DagsterGraphQLClient to a remote dagster instance (i.e. Dagster cloud)? It's unclear to me how I would provide authentication
d
Yeah, here's how it works on cloud (the syntax is a bit clunky, planning to smooth it out):
Copy code
from dagster_graphql import DagsterGraphQLClient
from gql.transport.requests import RequestsHTTPTransport
Copy code
url = "yourorg.dagster.cloud/prod"
token = "your_token_here" # a User Token generated from the Cloud Settings page in Dagster Cloud. Note: User Token, not Agent Token
Copy code
client = DagsterGraphQLClient(url, transport=RequestsHTTPTransport(url=url="/graphql", headers={"Dagster-Cloud-Api-Token": token}))
ty thankyou 1
z
awesome, thanks so much!
p
@Dagster Bot discussion Using the Python DagsterGraphQLClient against a Dagster Cloud instance
d
Question in the thread has been surfaced to GitHub Discussions for future discoverability: https://github.com/dagster-io/dagster/discussions/7772