-
Notifications
You must be signed in to change notification settings - Fork 9
/
products-schema.graphql
151 lines (132 loc) · 3.02 KB
/
products-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
150
151
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.8", import: ["@key"])
type Query {
"""
Get all available products to shop for. Optionally provide some search filters
"""
searchProducts(searchInput: ProductSearchInput! = {}): [Product]!
"""
Get all featured products to be listed
"""
getFeaturedProducts(limit: Int): [Product]!
"""
Get products based on a single category
"""
getProductsByCategory(category: ProductCategory!, limit: Int): [Product]!
"""
Get all available variants of products to shop for. Optionally provide some search filters
"""
searchProductVariants(searchInput: VariantSearchInput! = {}): [ProductVariant]!
"""
Get a specific product by id. Useful for the product details page or checkout page
"""
product(id: ID!): Product
"""
Get a specific variant by id. Useful for the product details page or checkout page
"""
productVariant(id: ID!): ProductVariant
}
"""
Available categories that a product can be classified as
"""
enum ProductCategory {
CLOTHING
TOPS
BOTTOMS
COLLECTIONS
WOMEN
MEN
HOODIES
SHORTS
PERFORMANCE
UNDERWEAR
ECO
PROMOTIONS
PANTS
RECOMMENDATIONS
TEES
YOGA
}
"""
Search filters for when returning Products
"""
input ProductSearchInput {
"Specify part of the title of the product"
titleContains: String
"Limit the number of items returned"
limit: Int
"Specify a set of categories that the product is a part of"
categories: [ProductCategory]
featured: Boolean
}
"""
Search filters for when returning Variants
"""
input VariantSearchInput {
sizeStartsWith: String
}
"""
A specific product sold by our store. This contains all the high level details but is not the purchasable item.
See Variant for more info.
"""
type Product @key(fields: "sku") @key(fields: "id") {
id: ID!
name: String!
sku: String!
description: String
images: [String]
price: Float!
attributes: [Attribute]
variants: [ProductVariant]
featured: Boolean!
shortDescription: String
}
type Attribute {
name: String!
values: [String]!
}
"""
A variant of a product which is a unique combination of attributes like size and color
Variants are the entities that are added to carts and purchased
"""
type ProductVariant @key(fields: "id") {
id: ID!
"""
Link back to the parent Product SKU
"""
parent: Product
"""
Optional color option for this variant
"""
colorway: String
"""
Price in decimals for this variant
"""
price: Float!
"""
Optional size option for this variant
"""
size: String
"""
Variant is available for purchase
"""
inStock: Boolean!
}
"""
A user account in our system
"""
type User @key(fields: "id") {
id: ID!
}
#"""
#A specific review by a user about a product. This contains all the high level details about a review including the body of the review.
#"""
#type Review @key(fields: "id") {
#ADD REVIEW FIELDS AND RETURN TYPES HERE
#}
#"""
#A Subscription for whenever a new review has been added.
#"""
#type Subscription {
#ADD SUBSCRIPTION FIELDS AND RETURN TYPES HERE
#}