0

We have one appsync instance that execute use two lambdas as data source , the information its requested in this way

query MyQuery {
getOrder(userName: "user", uuid: "some uuid") {
status
  }

  updateTicketNumber(terminalId: "1", userName: "some user") {
    ticketNumber
  }
}

There is way that if the status is invalid do not perform second query?

1 Answers1

0

Taking graphql specs only ... mixed query with mutation ('update' means mutation?) - should be processed separately, each in own operation.

... batched 'multi-queries' are not guaranteed to be processed in order, while 'multi-mutations' are processed serially - following mutation resolver can rely on previous mutation result/values.

There is no graphql syntax to execute queries conditionally. It can be 'simulated' only in queries being parent-child related (child resolver checks parent prop).

Make 2 requests/operations - condition based on 1st result/response.

xadm
  • 8,219
  • 3
  • 14
  • 25