-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
149 lines (124 loc) · 2.6 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
type ArgumentError implements Error {
fieldErrors: [ZodFieldError!]!
message: String!
}
type CartItem {
id: ID!
productVariant: ProductVariant!
quantity: Int!
user: User!
}
type Category {
description: String
id: ID!
name: String!
products(limit: Int, offset: Int): [Product!]!
}
scalar Date
interface Error {
message: String!
}
type LogicalError implements Error {
message: String!
}
type Mutation {
addCartItem(
"""Quantity"""
quantity: Int!
"""ProductVariantId"""
variantId: String!
): MutationAddCartItemResult!
createMyOrder(cartItemIDs: [String!]!, payments: [PaymentInput!]!, status: String!): MutationCreateMyOrderResult!
removeCartItem(
"""cartItemId"""
id: String!
): MutationRemoveCartItemResult!
updateCartItem(
"""CartItemId"""
id: String!
"""Quantity"""
quantity: Int!
): MutationUpdateCartItemResult!
}
union MutationAddCartItemResult = ArgumentError | LogicalError | MutationAddCartItemSuccess
type MutationAddCartItemSuccess {
data: CartItem!
}
union MutationCreateMyOrderResult = ArgumentError | LogicalError | MutationCreateMyOrderSuccess
type MutationCreateMyOrderSuccess {
data: Order!
}
union MutationRemoveCartItemResult = ArgumentError | LogicalError | MutationRemoveCartItemSuccess
type MutationRemoveCartItemSuccess {
data: CartItem!
}
union MutationUpdateCartItemResult = ArgumentError | LogicalError | MutationUpdateCartItemSuccess
type MutationUpdateCartItemSuccess {
data: CartItem!
}
type Order {
createdAt: Date!
id: ID!
items: [CartItem!]!
status: String!
transactions: [Transaction!]!
user: User!
}
input PaymentInput {
type: String!
value: Float!
}
type Product {
description: String
id: ID!
labelPrice: Float
name: String!
variants: [ProductVariant!]!
}
type ProductImage {
id: ID!
position: Int!
source: String!
}
type ProductVariant {
id: ID!
image: ProductImage!
price: Float!
product: Product!
title: String
}
type Query {
categories(limit: Int, offset: Int): [Category!]!
category(
"""categoryId"""
id: String!
): Category!
me: User!
myCart: [CartItem!]!
myOrder(id: String!): Order!
myOrders(limit: Int, offset: Int): [Order!]!
order(id: String!): Order!
orders(limit: Int, offset: Int): [Order!]!
products(limit: Int, offset: Int): [Product!]!
user(
"""userId"""
id: String!
): User!
users: [User!]!
}
type Transaction {
id: ID!
order: Order!
paymentType: String!
user: User!
value: Float!
}
type User {
email: String!
id: ID!
orders: [Order!]!
}
type ZodFieldError {
message: String!
path: [String!]!
}