Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 1.16 KB

2.md

File metadata and controls

30 lines (26 loc) · 1.16 KB

Snowtooth

Mutations - Change records in a database

mutation {                                                  # Every change request starts with the keyword mutation
  setTrailStatus(id: "goosebumps" status: CLOSED) {         # Change goosebumps status to closed
    name                                                    # Return name and status of goosebumps after modification
    status
  }
}

Fragments - Collection of fields which can be used in a query

query {
  allLifts {
    ...details                                              # Fragment name used here
  }
}

fragment details on Lift {                                  # Fragment definition
  id                                                        # Fields within the fragment
  name
  status
}

Subscriptions - Listener for any modifications to a specified field

subscription {                                              # Every listener request starts with the keyword subscription
  liftStatusChange {                                        # Observes changes in the following fields
    name
    status
  }
}