forked from scandipwa/catalog-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphqls
executable file
·93 lines (78 loc) · 3.43 KB
/
schema.graphqls
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
##
# ScandiPWA_CatalogGraphQl
#
# @category ScandiPWA
# @package ScandiPWA_CatalogGraphQl
# @author Viktors Pliska <[email protected]>
# @author Valerijs Sceglovs <[email protected]>
# @author Raivis Dejus <[email protected]>
# @copyright Copyright (c) 2018 Scandiweb, Ltd (https://scandiweb.com)
##
type MediaGalleryImageOfType @doc(description: "Products thumbnail image") {
type: String @doc(description: "Product image type")
url: String @doc(description: "Product image url")
}
input ProductFilterInput {
id: FilterTypeInput @doc(description: "Product id")
category_url_key: FilterTypeInput @doc(description: "Category url_key the product belongs to")
category_url_path: FilterTypeInput @doc(description: "Category url_path the product belongs to")
conditions: FilterTypeInput @doc(description: "Searches products by JSON formatted conditions")
}
input ProductSortInput {
position: SortEnum @doc(description: "A number assigned to a product")
}
type MediaGalleryEntry @doc(description: "MediaGalleryEntry defines characteristics about images and videos associated with a specific product") {
thumbnail: MediaGalleryImageOfType @doc(description: "The path of the thumbnail image on the server thumbnail")
base: MediaGalleryImageOfType @doc(description: "The path of the thumbnail image on the server thumbnail")
}
type ProductImage @doc(description: "Extend product Image fields for frontend-driven loading mechanism") {
path: String @doc(description: "Relative path to origin image") @resolver(class:"ScandiPWA\\CatalogGraphQl\\Model\\Resolver\\Product\\ProductImage\\Path")
}
type Query {
category (
id: Int @doc(description: "Ids of the category")
url_path: String @doc(description: "Url path of the category")
): CategoryTree
@resolver(class: "ScandiPWA\\CatalogGraphQl\\Model\\Resolver\\CategoryTree")
}
type CategoryTree {
is_active: Boolean @doc(described: "Category is enabled")
}
interface ProductInterface {
attributes: [AttributeWithValue] @resolver(class:"ScandiPWA\\CatalogGraphQl\\Model\\Resolver\\AttributesWithValue")
stock_item: ProductStockItem @resolver(class: "ScandiPWA\\CatalogGraphQl\\Model\\Resolver\\Inventory\\StockCount")
}
interface CategoryInterface {
canonical_url: String @doc(description: "Canonical Url") @resolver(class: "ScandiPWA\\CatalogGraphQl\\Model\\Resolver\\Category\\CanonicalUrl")
}
type AttributeWithValue {
attribute_code: String
entity_type: String
attribute_type: String
attribute_value: String
attribute_label: String
attribute_id: Int
attribute_options: [AttributeWithValueOption]
}
type AttributeWithValueOption {
label: String
value: String
swatch_data: AttributeWithValueSwatchData
}
type AttributeWithValueSwatchData {
type: String
value: String
}
type Products {
min_price: Float @doc(description: "Minimal price among all selected items")
max_price: Float @doc(description: "Maximal price among all selected items")
}
type CategoryProducts {
min_price: Float @doc(description: "Minimal price among all selected items")
max_price: Float @doc(description: "Maximal price among all selected items")
}
type ProductStockItem {
qty: Int @doc(description: "Product quantity available in stock")
min_sale_qty: Int @doc(description: "Minimal amount of item that can be bought")
max_sale_qty: Int @doc(description: "Maximal amount of item that can be bought")
}