generated from BRAVO68WEB/typescript-express-hasura-pgsql-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
120 lines (104 loc) · 2.46 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
### This file was generated by Nexus Schema
### Do not make changes to this file directly
type AuthType {
token: String!
user: User!
}
type Brand {
id: Int!
name: String!
}
type BuyCartResponse {
message: String
success: Boolean
}
type Cart {
creatorId: Int
id: Int
productId: Int
}
type Category {
id: Int!
name: String!
}
type Mutation {
addReview(productId: Int!, rating: Int!, review_text: String!, title: String!): Review!
addToCart(creatorId: Int!, productId: Int!): Cart!
addToWishlist(productId: Int!): Wishlist!
buyCart: BuyCartResponse
createBrand(name: String!): Brand!
createProduct(available: Boolean!, brandId: Int!, categoryId: Int!, description: String!, id: Int!, name: String!, price: Float!): Product!
deleteReview(reviewId: Int!): Review!
login(password: String!, username: String!): AuthType!
register(email: String!, first_name: String!, last_name: String!, password: String!, username: String!): AuthType!
removeFromCart(productId: Int!): Cart!
removeFromWishlist(productId: Int!): Boolean!
updateProduct(available: Boolean!, brandId: Int!, categoryId: Int!, description: String!, name: String!, price: Float!, productId: Int!): Product!
updateUserData(address: String, first_name: String!, last_name: String!, phone_number: String): User!
}
type Order {
id: Int!
status: String!
}
type OrderItem {
id: Int
productId: Int
quantity: Int
subtotal: Float
unit_price: Float
}
type Product {
ImageDetail: [ProductImage]!
available: Boolean!
brandId: Int!
categoryId: Int!
createdBy: User
creatorId: Int!
description: String!
id: Int!
name: String!
price: Float!
}
type ProductImage {
id: Int
key: String
productId: Int
}
type Query {
Wishlist: [Wishlist!]!
fetchCart: [Cart]!
fetchOrderItems: [[OrderItem]]
fetchProduct(productId: Int): [Product!]!
fetchProductByBrand(brandId: Int!): [Product!]!
fetchProductByCategory(categoryId: Int!): [Product!]!
fetchReview(productId: Int!): [Review!]!
fetchUserReviw(userId: Int): [Review]!
orderData: [Order]!
products(searchKeyword: String): [Product!]!
userData(userId: Int!): User!
}
type Review {
createdAt: String!
id: Int!
rating: Int!
review_text: String!
title: String!
}
type User {
address: String
email: String!
first_name: String!
id: Int!
last_name: String!
phone_number: String
role: UserRole!
username: String!
}
enum UserRole {
ADMIN
USER
}
type Wishlist {
id: Int!
product: Product!
}