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