Zach
09/23/2020, 3:34 PMquery {
flow_run_state {
flow_run {
id,
parameters,
created,
flow(where:{name:"my-flow-name"}) {
name,
id
},
}
}
}
Error:
{
"graphQLErrors": [
{
"message": "Unknown argument \"where\" on field \"flow\" of type \"flow_run\".",
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED"
}
}
],
"networkError": null,
"message": "GraphQL error: Unknown argument \"where\" on field \"flow\" of type \"flow_run\"."
}
nicholas
09/23/2020, 3:39 PMwhere
clause on a nested field. Something like this should work instead:
query {
flow_run_state(where: {flow_run: {flow: {name: {_eq: "my-flow-name"}}}}) {
flow_run {
id,
parameters,
created,
flow {
name,
id
},
}
}
}
Zach
09/23/2020, 3:41 PMwhere
clauses need to be at the top of the query?nicholas
09/23/2020, 3:58 PMZach
09/23/2020, 5:20 PMwhere
clauses and now it times out every timenicholas
09/23/2020, 5:20 PMZach
09/23/2020, 5:22 PMquery {
flow_run_state(where:
{
state: {_eq: "Success"},
created: {_gt: "2020-09-11T23:09:48.215241+00:00"}
flow_run: {
task_runs: {task: {name: {_eq: "task-name"}}}
flow: {name: {_eq: "flow-name"}}
}
}
) {
state,
flow_run {
id,
created,
flow {
name,
},
task_runs {
task {
name
}
start_time,
end_time
}
}
}
}
nicholas
09/23/2020, 5:24 PMflow_run { flow { id } }
Hasura creates a JOIN
between the two tables. Sometimes this is performant and expected, but other times it's not, due to the size of the tables and/or the shape of the ORDER_BY
and WHERE
clauses it generates.JOIN
includes nested fields in the where
clausequery TaskRunDuration {
flow_run(where: { flow_id: {_eq: "your_flow_id"}, state: {_eq: "Success"} }) {
id
name
task_runs(where: {task_id: {_eq: "your_task_id"}}) {
start_time
end_time
id
}
}
}
Zach
09/23/2020, 7:59 PMnicholas
09/23/2020, 8:00 PM