-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschema.graphql
80 lines (79 loc) · 1.49 KB
/
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
68
69
70
71
72
73
74
75
76
77
78
79
80
type QueryRoot {
healthCheck: Boolean!
customers: [Customer!]!
customer: Customer!
cart: ShoppingCart!
}
"""
Graphql Resolver
"""
type Customer {
id: UUID!
email: String!
firstName: String!
lastName: String!
createdAt: DateTime!
lastModified: DateTime!
cart: ShoppingCart!
}
scalar UUID
"""
Implement the DateTime<Utc> scalar
The input/output is a string in RFC3339 format.
"""
scalar DateTime
type ShoppingCart {
id: UUID!
cartType: CartType!
discounts: [UUID!]
priceBeforeDiscounts: Float!
priceAfterDiscounts: Float!
currency: Currency!
createdAt: DateTime!
lastModified: DateTime!
items: [CartItem!]!
}
enum CartType {
ANONYMOUS
KNOWN
}
enum Currency {
GBP
USD
}
type CartItem {
sku: String!
quantity: Int!
pricePerUnit: Float!
name: String!
description: String!
imgSrc: String!
tags: [String!]!
}
type MutationRoot {
login(email: String!, password: String!): BazaarTokens!
anonymousLogin: BazaarTokens!
refresh: BazaarTokens!
signUp(email: String!, password: String!, firstName: String!, lastName: String!): BazaarTokens!
updateCustomer(update: [CustomerUpdate!]!): Customer!
addItemsToCart(newItems: [UpdateCartItem!]!): ShoppingCart!
removeItemsFromCart(removedItems: [UpdateCartItem!]!): ShoppingCart!
}
type BazaarTokens {
issuedAt: Int!
accessTokenExpiresIn: Int!
refreshTokenExpiresIn: Int!
tokenType: String!
}
input CustomerUpdate {
key: String!
value: String!
}
input UpdateCartItem {
sku: String!
quantity: Int!
}
schema {
query: QueryRoot
mutation: MutationRoot
}