Skip to content

Instantly share code, notes, and snippets.

@maticzav
Created May 28, 2018 18:23
Show Gist options
  • Save maticzav/402b4e95b36ccbf0ad2ff889956ea583 to your computer and use it in GitHub Desktop.
Save maticzav/402b4e95b36ccbf0ad2ff889956ea583 to your computer and use it in GitHub Desktop.
# src/schema.graphql
type Query {
viewer: Viewer
products: [Product!]!
}
type Mutation {
addItemToBasket(productId: ID!): Viewer
removeItemFromBasket(itemId: ID!): Viewer
addProduct(name: String!, description: String!, price: Int!): Product!
removeProduct(id: ID!): Product!
}
type Viewer {
email: String!
basket: [ProductItem!]!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment