Untitled

 avatar
unknown
javascript
2 years ago
1.2 kB
7
Indexable
mutation updateOrderStatus($id: ID!, $status: OrderStatus!) {
  updateOrderStatus(id: $id, status: $status) {
    id
    status
    newtime:   # optionally specify new field names
      @skip(if: $status != NEW) 
      @include(if: $status == NEW) 
      # Add other fields (e.g. `newtime`, `acceptedtime`, etc.) as needed
    acceptedtime:
      @skip(if: $status != ACCEPTED) 
      @include(if: $status == ACCEPTED)
    cookedtime:
      @skip(if: $status != COOKED) 
      @include(if: $status == COOKED)
    dispatchtime:
      @skip(if: $status != DISPATCHED) 
      @include(if: $status == DISPATCHED)
    deliveredtime:
      @skip(if: $status != DELIVERED) 
      @include(if: $status == DELIVERED)
    billedtime:
      @skip(if: $status != BILLED) 
      @include(if: $status == BILLED)
    completedtime:
      @skip(if: $status != COMPLETED) 
      @include(if: $status == COMPLETED)
  }
}


/// mutation 

mutation {
  updateOrderStatus(
    orderId: "123"
    status: "cooked"
  ) {
    orderId
    status
    acceptedTime
    cookedTime
    dispatchTime
    deliveredTime
    billedTime
    completedTime
  }
}
Editor is loading...