Hi folks, I am running a graphql mutation to delet...
# ask-community
m
Hi folks, I am running a graphql mutation to delete a flow but I can still see the flow on the UI even after refreshing - is this because there are older versions of the flow ? I see there is an option to delete all the versions of a flow from the UI, is there an equivalent approach using graphql to do so?
n
Hi @Marwan Sarieddine - there should be a
DELETE
button in the top right of the flow page that has a checkbox to delete all versions of the flow.
m
Hi @nicholas thank you for the quick response - that's correct, I am asking about how to delete the flow and all its versions using graphql and not the UI (sorry if that wasn't clear)
I tried this - and it don't see where to specify deleting all the versions ...
Copy code
mutation{
  deleteFlow(input:{flowId: "myflowid"}){
    success,
    error
  }
}
n
Oh sorry, I misunderstood. You'll need to query for all the versions of your flow and then loop through them to delete
m
I see
n
So something like this:
Copy code
query {
  flow(where: {flow_group_id: {_eq: "<<id>>" } }}) {
    id
  }
}
(using the flow group id is the best way to get all the versions for that flow)
m
gotcha - thanks will give it a try
n
👍 Lmk if you run into any issues.
m
just tried it out - it works - thanks again 🙂
n
Great! 😄