Search code examples
parse-platformgraphql

Parse Platform Graphql Batch Update


im getting a problem when using graphql in parse platform

i want running a multiple mutation update with single mutation or batch. i have success when creating data, but for updating data im getting error.

im try like this

mutation ($objectId1: ID!, $objectId2: ID!) {
  update1: updateCourse(
    objectId: $objectId1
    fields: { title: "HEBOH", slug: "HEBOH ITU KEREN ANJIR" }
  ),
  update2: updateCourse(
    objectId: $objectId2
    fields: { title: "HEBOH", slug: "HEBOH ITU KEREN ANJIR" }
  )
}

anyone can give me an example for this? Thankyou


Solution

  • in some time, I found the answer about it. simple, I forgot to add updatedAt

    
    mutation ($objectId1: ID!, $objectId2: ID!) {
      update1: updateCourse(
        objectId: $objectId1
        fields: { title: "HEBOH", slug: "HEBOH ITU KEREN ANJIR" }
      ) { updatedAt },
      update2: updateCourse(
        objectId: $objectId2
        fields: { title: "HEBOH", slug: "HEBOH ITU KEREN ANJIR" }
      ) { updatedAt }
    }