I am trying to run a graphql query in Python using the below code:
params={
"date_obj":"2022-07-18T013226.584864+00:00",
"curr_obj":"2022-07-18T053226.584864+00:00",
}
query=client.graphql(
{
'query($date_obj: timestamptz=': { 'flow_run(where: {start_time: {_gte: $date_obj}})': {
'flow_id'
}
}
however the parameter value for date_obj is not getting passed.
Can someone please help on this
It errored out with below message
GRAPHQL_PARSE_FAILED: Syntax Error: Unexpected single quote character ('), did
you mean to use a double quote (")?
The passed variables were:
{"date_obj": "2022-07-18T013226.584864+00:00"}
Farooque Shaikh
07/18/2022, 3:58 PM
this is my code
query = """
query flowRun ($date_obj: timestamptz) {
flow_run(where: {start_time: {_gte: $date_obj}}) {
'flow_id',
'id',
'name',
'start_time',
'end_time',
'state',
'state_message',
'state_result',
'state_start_time',
'state_timestamp',
'tenant_id',
'times_resurrected',
'updated',
'version'
}
}
"""
vars = {
"date_obj":"2022-07-18T013226.584864+00:00"
}
print(client.graphql(query,variables=vars))
k
Kevin Kho
07/18/2022, 3:59 PM
I think that’s because you wrapped all of the id, name, start_time, end_time in quotes
f
Farooque Shaikh
07/18/2022, 4:02 PM
Got you, it worked now, thank you so much for your quick help.. Really Appreciate
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.