generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.graphql
119 lines (101 loc) · 1.91 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
#graphql
extend schema @link(url: "https://specs.apollo.dev/federation/v2.0" import: ["@key", "@shareable"])
scalar Date
enum CacheControlScope {
PUBLIC
PRIVATE
}
directive @cacheControl(
maxAge: Int
scope: CacheControlScope
inheritMaxAge: Boolean
) on FIELD_DEFINITION | OBJECT | INTERFACE | UNION
# TODO: determine types in use
enum ImageType {
FULL_FIGURE
LEGER
OTHER
CATALOG
AMBIENTE
}
enum TargetGroup {
WOMEN
MEN
KIDS
UNISEX
}
enum Feature {
SUSTAINABLE
}
enum ProductGroup {
APPAREL
OTHER
}
type Image {
id: String!
path: String!
imageType: ImageType
}
type Brand {
name: String!
logo: Image
}
type Currency {
code: String
text: String
}
type Price {
currency: Currency
value: Int
}
enum AvailabilityStatus {
AVAILABLE
UNAVAILABLE
OUTOFSTOCK
TEMP
}
type Availability {
deliverable: Boolean
stock: Int
status: AvailabilityStatus
text: String
}
# The product gets cached for 8 hours
type Product @key(fields: "id") @cacheControl(maxAge: 28800) {
id: ID!
name: String!
teaserImage: Image!
shop: Shop!
description: String!
publishDate: Date
targetGroups: [TargetGroup]
features: [Feature]
aggregatedAvailability: Availability
variants(color: String, size: String, attribute: String): [ProductVariant]
fromPrice(color: String, size: String, attribute: String): Price
}
type Shop @key(fields: "id", resolvable: false) {
id: ID!
}
type ProductVariant @key(fields: "id") {
id: ID!
# reference back to parent product, useful in federation
parentProduct: Product!
attribute: String
color: String!
size: String!
availability: Availability
price: Price!
formerPrice: Price
# suggested retail price / UVP
srp: Price
}
type ProductVariantSizeGroup @key(fields: "id") {
id: ID! # itemNumber/Artikelnummer
parentProduct: Product!
variants: [ProductVariant]!
}
type Query {
products: [Product]
product(id: String!): Product
}