-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdatamodel.graphql
57 lines (52 loc) · 926 Bytes
/
datamodel.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
enum Permission {
ADMIN
USER
ITEMCREATE
ITEMUPDATE
ITEMDELETE
PERMISSIONUPDATE
}
type User {
id: ID! @id
name: String!
email: String! @unique
password: String!
resetToken: String
resetTokenExpiry: Float
permissions: [Permission] @scalarList (strategy: RELATION)
cart: [CartItem!]!
}
type Item {
id: ID! @id
title: String!
description: String!
image: String
largeImage: String
price: Int!
createdAt: DateTime @createdAt
user: User!
}
type CartItem {
id: ID! @id
quantity: Int! @default(value: 1)
item: Item #relationship to Item
user: User! #relationship to User
}
type OrderItem {
id: ID! @id
title: String!
description: String!
image: String!
largeImage: String!
price: Int!
quantity: Int! @default(value: 1)
user: User
}
type Order{
id: ID! @id
items: [OrderItem!]!
total: Int!
user: User!
charge: String!
createdAt: DateTime @createdAt
}