Hey community, Trying to write a graphql query th...
# ask-community
b
Hey community, Trying to write a graphql query that I can specify the
project
and the
flow name
and get a list of currently active flows and their state ( running, or complete etc ). Is this possible ? Cant seem to find anything for the use case...
k
I think something like:
Copy code
query{ 
  flow (where:{project: {name: {_eq: "test"}}, 
    name:{_eq: "test"}}){
    project {
      id
      name
    }
    name
    flow_runs{
      id
      name
      state
    }
  }
}
might work?
b
that is on the right track, but seems to show all versions of the flow, can we just get most recent?
k
Add
archived: {_eq: false}}
b
in the where clause?
k
Yes exactly
Copy code
query{ 
  flow (where:{project: {name: {_eq: "test"}}, 
    name:{_eq: "test"},
    archived: {_eq: false}}){
    project {
      id
      name
    }
    name
    archived
    flow_runs{
      id
      name
      state
    }
  }
}
b
Thanks so much @Kevin Kho
👍 1