Skip to content

Instantly share code, notes, and snippets.

@dncrews
Last active January 3, 2020 05:08
Show Gist options
  • Save dncrews/f621507faee225cec6bfb5d9e1d73993 to your computer and use it in GitHub Desktop.
Save dncrews/f621507faee225cec6bfb5d9e1d73993 to your computer and use it in GitHub Desktop.
Creating Order v1.1.0
type Order {
id: ID!
productsConnection: OrderProductsConnection!
}
input OrderInput {
lineItems: [OrderLineItemInput!]!
paymentToken: String!
}
input OrderLineItemInput {
productId: ID!
quantity: Int!
}
type OrderProductsConnection {
edges: [OrderProductsEdge!]!
}
type OrderProductsEdge {
quantity: Int!
node: Product!
}
extend type Product @key(fields: "id") {
id: ID! @external
}
extend type Query {
order(id: ID!): Order
}
extend type Mutation {
orderCreate(input: OrderInput!): Order!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment