Untitled

mail@pastecode.io avatar
unknown
javascript
8 months ago
1.2 kB
2
Indexable
Never
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
  }
}