This repository was archived by the owner on Mar 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathschema-shared.graphql
More file actions
166 lines (148 loc) · 3.19 KB
/
schema-shared.graphql
File metadata and controls
166 lines (148 loc) · 3.19 KB
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
"""
These are all just renamed strings right now
"""
scalar Url
scalar Markdown
scalar DateString
enum CacheControlScope {
PUBLIC
PRIVATE
}
"""
We need to manually implement cacheControl in the schema for now
https://stackoverflow.com/questions/52922080/how-to-implement-caching-on-apollo-server-hapi-graphql
https://github.com/apollographql/federation/issues/356
"""
directive @cacheControl(
maxAge: Int
scope: CacheControlScope
) on FIELD_DEFINITION | OBJECT | INTERFACE
extend type Item @key(fields: "givenUrl") {
"key field to identify the Item entity in the Parser service"
givenUrl: Url! @external
"If the item is a collection allow them to get the collection information"
collection: Collection
}
"""
valid language codes for collections
"""
enum CollectionLanguage {
"German"
DE
"English"
EN
}
"""
Interactive Advertising Bureau Category - these are used on clients to serve relevant ads
"""
type IABCategory {
externalId: String!
name: String!
slug: String!
}
type IABParentCategory {
externalId: String!
name: String!
slug: String!
children: [IABCategory!]!
}
"""
Type and enums related to Collections made in partnership with a company.
"""
enum CollectionPartnershipType {
PARTNERED
SPONSORED
}
"""
If a collection was made in partnership with an external company, this
entity will hold all required info about that partnership.
"""
type CollectionPartnership {
externalId: String!
type: CollectionPartnershipType!
name: String!
url: Url!
imageUrl: Url!
blurb: Markdown!
}
"""
A label used to mark and categorize an Entity (e.g. Collection).
"""
type Label {
externalId: ID!
name: String!
}
type Collection @key(fields: "slug") {
externalId: ID!
slug: String!
title: String!
excerpt: Markdown
status: CollectionStatus!
curationCategory: CurationCategory
intro: Markdown
imageUrl: Url
labels: [Label]
"""
note that language is *not* being used as locale - only to specify the
language of the collection.
"""
language: CollectionLanguage!
partnership: CollectionPartnership
publishedAt: DateString
authors: [CollectionAuthor!]!
stories: [CollectionStory!]!
"""
We will never return child categories in this type, so there's no need to
specify `IABParentCategory` here. The basic `IABCategory` is sufficient.
"""
IABParentCategory: IABCategory
IABChildCategory: IABCategory
}
enum CollectionStatus {
DRAFT
REVIEW
PUBLISHED
ARCHIVED
}
type CollectionAuthor {
externalId: ID!
name: String!
slug: String
bio: Markdown
imageUrl: Url
active: Boolean!
}
type CurationCategory {
externalId: ID!
name: String!
slug: String!
}
type CollectionStory @key(fields: "item { givenUrl }") {
externalId: ID!
url: Url!
title: String!
excerpt: Markdown!
imageUrl: Url
authors: [CollectionStoryAuthor!]!
publisher: String
sortOrder: Int
item: Item
"""
if True, the story is provided by a partner and should be displayed as such
"""
fromPartner: Boolean!
}
type CollectionStoryAuthor {
name: String!
sortOrder: Int!
}
type CollectionsResult {
pagination: Pagination!
collections: [Collection!]!
}
type Pagination {
currentPage: Int!
totalPages: Int!
totalResults: Int!
perPage: Int!
}