Skip to content

Latest commit

 

History

History
27 lines (22 loc) · 388 Bytes

File metadata and controls

27 lines (22 loc) · 388 Bytes

Nested mutations

Sometimes, nested mutations and queries are very handy and can help to keep code more encapsulated

This example will allow mutation like

mutation {
  book(bookId: 2) {
    edit(name: "Lord of the Rings") {
      id
      name
    }
  }
}

instead of

mutation {
  editBook(bookId: 2, name: "Lord of the Rings") {
    id
    name
  }
}