Skip to content

Instantly share code, notes, and snippets.

@dncrews
Last active January 3, 2020 05:00
Show Gist options
  • Save dncrews/c1b124a93476df0efc4c45ee1436bd49 to your computer and use it in GitHub Desktop.
Save dncrews/c1b124a93476df0efc4c45ee1436bd49 to your computer and use it in GitHub Desktop.
Simple E-Commerce v1.0.0
type Inventory {
total: Int!
available: Int!
}
extend type Product @key(fields: "id") {
id: ID! @external
inventory: Inventory!
}
input ProductAddInventoryInput {
productId: ID!
quantityToAdd: Int!
}
extend type Mutation {
productAddInventory(input: ProductAddInventoryInput): Product!
}
extend type Query {
product(id: ID!): Product
}
type Product @key(fields: "id") {
id: ID!
name: String!
}
input ProductCreateInput {
name: String!
}
extend type Mutation {
productCreate(input: ProductCreateInput): Product!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment