Dexter Antonio
02/25/2022, 9:52 PMclient.graphql
. This is the graphql query that I want to use. It works on the prefect cloud’s interactive api;
query {
flow(where: {name: {_eq: "autoscorer"}, version:{_eq:10}}) {
id
name
version
tasks{
name
id
}
}}
This is my attempt to do it with the client.graphql
.
client.graphql(
{
'query': {
'flow(where: {name: {_eq: "autoscorer"}, version:{_eq:10}})': {
#'id',
#'name',
#'version',
'tasks': {'task_runs': {'id', 'name'}},
},
}
})
This works, but if I uncomment the commented fields (e.g. id
,) I get a syntax error. What is the proper syntax to indicate a root field? Is there any documentation how to use this API in more detail? Is it based off of a common Python GraphQL library?Kevin Kho
02/25/2022, 10:04 PMfrom prefect.client import Client
client = Client()
f = client.graphql(
"""
query {
flow(where: {name: {_eq: "autoscorer"}, version:{_eq:10}}) {
id
name
version
tasks{
name
id
}
}}
"""
)
print(f)
Dexter Antonio
02/25/2022, 10:31 PM