-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
67 lines (57 loc) · 1019 Bytes
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
type Query {
cart(id: ID!): Cart
}
type Mutation {
addItem(input: AddToCartInput!): Cart
removeItem(input: RemoveFromCartInput!): Cart
increaseCartItem(input: IncreaseCartItemInput!): Cart
decreaseCartItem(input: DecreaseCartItemInput!): Cart
createCheckoutSession(input: CreateCheckoutSessionInput!): CheckoutSession
}
type Cart {
id: ID!
totalItems: Int!
items: [CartItem!]!
subTotal: Money!
}
type Money {
formatted: String!
amount: Int!
}
type CheckoutSession {
id: ID!
url: String
}
type CartItem {
id: ID!
name: String!
description: String
unitTotal: Money!
lineTotal: Money!
quantity: Int!
image: String
}
input AddToCartInput {
cartId: ID!
id: ID!
name: String!
description: String
image: String
price: Int!
quantity: Int = 1
}
input RemoveFromCartInput {
id: ID!
cartId: ID!
}
input IncreaseCartItemInput {
id: ID!
cartId: ID!
}
input DecreaseCartItemInput {
id: ID!
cartId: ID!
}
input CreateCheckoutSessionInput {
cartId: ID!
}