This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
generated from Pocket/backend-typescript-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathschema-public.graphql
157 lines (137 loc) · 3.65 KB
/
schema-public.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
152
153
154
155
156
157
type Image @key(fields: "url") {
url: Url!
}
"""
A scheduled entry for an CorpusItem to appear on a Scheduled Surface.
For example, a story that is scheduled to appear on December 31st, 2021 on the Scheduled Surface in Firefox for the US audience.
"""
type ScheduledSurfaceItem {
"""
A backend GUID that represents this scheduled run
"""
id: ID!
"""
Agreed on GUID that is from our shared data pocket confluence
"""
surfaceId: ID!
"""
The date the item should run at
"""
scheduledDate: Date!
"""
The curated item that should run
"""
corpusItem: CorpusItem!
}
type SyndicatedArticle @key(fields: "slug") {
slug: String!
}
type Collection @key(fields: "slug") {
slug: String!
}
"""
TODO: Make this type implement PocketResource when available.
https://getpocket.atlassian.net/wiki/spaces/PE/pages/2771714049/The+Future+of+Item
"""
union CorpusTarget = SyndicatedArticle | Collection
"""
Represents an item that is in the Corpus and its associated manually edited metadata.
TODO: CorpusItem to implement PocketResource when it becomes available.
"""
type CorpusItem @key(fields: "id") @key(fields: "url") {
"""
The GUID that is stored on an approved corpus item
"""
id: ID!
"""
The URL of the Approved Item.
"""
url: Url!
"""
The title of the Approved Item.
"""
title: String!
"""
The excerpt of the Approved Item.
"""
excerpt: String!
"""
What language this item is in. This is a two-letter code, for example, 'EN' for English.
"""
language: CorpusLanguage!
"""
The name of the online publication that published this story.
"""
publisher: String!
"""
The image URL for this item's accompanying picture.
"""
imageUrl: Url!
"""
The image for this item's accompanying picture.
"""
image: Image!
"""
The author names and sort orders associated with this CorpusItem.
"""
authors: [CorpusItemAuthor!]!
"""
The topic associated with the Approved Item.
"""
topic: String
"""
If the Corpus Item is pocket owned with a specific type, this is the associated object (Collection or SyndicatedArticle).
"""
target: CorpusTarget
}
"""
Represents a surface that has scheduled items by day
"""
type ScheduledSurface {
"""
Agreed on GUID that is from our shared data pocket confluence
"""
id: ID!
"""
Internal name of the surface
"""
name: String!
"""
Subquery to get the ScheduledSurfaceItems to display to a user for a given date
"""
items(date: Date!): [ScheduledSurfaceItem!]!
}
"""
Union type to reference a surface
This is a future improvement, not needed now.
"""
union Surface = ScheduledSurface
type Query {
scheduledSurface(id: ID!): ScheduledSurface!
"""
This is a future improvement, not needed now.
"""
surface(id: ID!): Surface!
}
type SavedItem @key(fields: "url") {
"""
key field to identify the SavedItem entity in the ListApi service
"""
url: String! @external
"""
If the item is in corpus allow the saved item to reference it. Exposing curated info for consistent UX
"""
corpusItem: CorpusItem
}
# Commented out until RecsAPI implements the fields that lets us extend Recommendation
#extend type Recommendation @key(fields: "corpusItemId") {
# """
# key field to identify the CorpusItem entity in the RecsAPI service
# """
# corpusItemId: ID! @external
#
# """
# If the item is in our corpus with metadata lets define it, this would replace the older curatedInfo object.
# """
# corpusItem: CorpusItem @requires(fields: "corpusItemId")
#}