How to delete a list of nodes by a field value?

Hi,

Is possible to delete o set of nodes using any field value as filter and passing a list of match values?

type Post {
id: ID:
title: String
author: String
}

For example, delete all authors in [ “Jason”, “Joline”, “Machado” … ].

1 Like

Is this a GraphQL question?

Yes, I would like create a mutation to delete all nodes based on a list of values for a specific field.

Okay, moving it to GraphQL category.

Also, I’m not sure if we have that kind of delete.
pinging @graphql

1 Like

Hi @tiagoantunes, yeah you can do this with GraphQL.
Here, is the delete mutation.

  mutation deleteAuthor{
      deletePost(filter:{author:{in:["Jason","Joline","Machado"]}}){
       msg
       title
       author
      }
    }

I guess in filter is added recently and is currently available in master and will be available in 20.11.

4 Likes

Thanks @JatinDevDG

We will look to the “in” operator when it is available.

I was looking for some workaround for now. But I believe I will have to wait or start to use the release candidate.

Thanks again.