Search code examples
vue.jsgraphqlapollo

Delete many records in one query on 8base


On 8base I try to delete multiples records in one query on my app but nothing seems to work properly because the two arguments of the delete mutation (data and filter) does not seems to support array of Ids.

Is the there a way to do that properly in one query ?

Same thing on nested data, is the there a way to delete for example an user and all this posts in one query ?

Thank you in advance !


Solution

  • There is this community post that answers the question: https://community.8base.com/t/delete-many-records-in-one-query/464/3

    I also included one part of a solution here:

    mutation {
      user1: userDelete(data: { id: "id1" }) { success }
      user2: userDelete(data: { id: "id2" }) { success }
      user3: userDelete(data: { id: "id3" }) { success }
      user4: userDelete(data: { id: "id4" }) { success }
      ...etc
    }