Mitch Masia
Building awesome products using React, React Native, GraphQL, and Elixir.
type User {
email: String!
firstName: String
id: ID!
lastName: String
}
input UserInput {
email: String!
firstName: String
lastName: String
}
type Query {
currentUser: User!
}
type Mutation {
register(user: UserInput!): User!
}
type CartItem {
productId: ID!
quantity: Int!
}
type Cart {
items: [CartItem!]!
}
input CartItemInput {
productId: ID!
quantity: Int!
}
type Query {
cartForCurrentUser: Cart!
}
type Mutation {
addItemToCart(cartItem: CartItemInput!): Cart!
}
enum OrderStatus {
CANCELLED
COMPLETE
NEW
}
type Order {
id: ID!
status: OrderStatus!
}
input CreateOrderInput {
stripeCardToken: String!
}
type Query {
ordersForCurrentCustomer: [Orders!]!
}
type Mutation {
createOrder(inputs: CreateOrderInput!): Order!
}
By Mitch Masia
A serverless GraphQL API gateway PoC
Building awesome products using React, React Native, GraphQL, and Elixir.