-
Notifications
You must be signed in to change notification settings - Fork 1
/
schema.graphql
124 lines (111 loc) · 2.28 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
### This file was generated by Nexus Schema
### Do not make changes to this file directly
type CartItem {
id: ID!
item: Item
quantity: Int!
user: User!
}
"""
A date string, such as 2007-12-03, compliant with the `full-date` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.
"""
scalar Date
type Item {
description: String!
id: ID!
image: String
largeImage: String
price: Int!
title: String!
user: User!
userId: String!
}
type ItemConnection {
hasMore: Boolean!
items: [Item]!
total: Int!
}
input ItemsInput {
description: String
title: String
}
type Mutation {
addToCart(id: ID!): CartItem
checkout(token: String!): Order!
createItem(
description: String!
image: String
largeImage: String
price: Int!
title: String!
): Item!
deleteCartItem(id: ID!): CartItem
deleteItem(id: ID!): Item
requestReset(email: String!): SuccessMessage!
resetPassword(
confirmPassword: String!
password: String!
resetToken: String!
): User!
signin(email: String!, password: String!): User
signout: SuccessMessage!
signup(email: String!, name: String!, password: String!): User!
updateItem(description: String, id: ID!, price: Int, title: String): Item!
updatePermissions(permissions: [Permission], userId: ID!): User
updateUser(id: ID!, name: String!): User!
}
type Order {
charge: String!
createdAt: Date!
id: ID!
items: [OrderItem!]!
total: Int!
updatedAt: Date!
user: User!
}
type OrderItem {
description: String!
id: ID!
image: String!
largeImage: String!
price: Int!
quantity: Int!
title: String!
user: User
}
enum Permission {
ADMIN
ITEMCREATE
ITEMDELETE
ITEMUPDATE
PERMISSIONUPDATE
USER
}
type Query {
allItems(searchTerm: String): [Item]!
item(id: ID!): Item
items(limit: Int, offset: Int): ItemConnection!
order(id: ID!): Order
orders: [Order]!
user: User
users: [User]
}
type SuccessMessage {
message: String!
}
type User {
cart: [CartItem!]!
email: String!
id: ID!
name: String!
orders: [OrderItem]
password: String!
permissions: [Permission]
resetToken: String
resetTokenExpiry: Float
}
type UserInput {
email: String!
name: String!
password: String!
}