-
-
Notifications
You must be signed in to change notification settings - Fork 44
/
ghost-schema.js
195 lines (186 loc) · 4.74 KB
/
ghost-schema.js
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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
/**
* Custom schema with types based on the Ghost V4 API spec.
*
* Note that GhostPost and GhostPage are identical.
*
* Foreign Keys are linked by 'slug'.
*
* `GhostNavigation` and `GhostPostCount` are custom types which do not become nodes.
* They instead represent the shape of objects returned by the Ghost API for navigation and post count.
*/
const types = `
type GhostPost implements Node {
slug: String!
id: ID!
uuid: String!
title: String!
html: String
comment_id: String
feature_image: String
feature_image_caption: String
feature_image_alt: String
featured: Boolean!
visibility: String!
created_at: Date! @dateformat
updated_at: Date @dateformat
published_at: Date @dateformat
custom_excerpt: String
codeinjection_head: String
codeinjection_foot: String
codeinjection_styles: String
custom_template: String
canonical_url: String
send_email_when_published: Boolean
tags: [GhostTag] @link(from: "tags.slug" by: "slug")
authors: [GhostAuthor]! @link(from: "authors.slug" by: "slug")
primary_author: GhostAuthor! @link(from: "primary_author.slug" by: "slug")
primary_tag: GhostTag @link(from: "primary_tag.slug" by: "slug")
url: String!
excerpt: String
reading_time: Int
email_subject: String
plaintext: String
page: Boolean
og_image: String
og_title: String
og_description: String
twitter_image: String
twitter_title: String
twitter_description: String
meta_title: String
meta_description: String
email_subject: String
}
type GhostPage implements Node {
slug: String!
id: ID!
uuid: String!
title: String!
html: String
comment_id: String
feature_image: String
feature_image_caption: String
feature_image_alt: String
featured: Boolean!
visibility: String!
created_at: Date! @dateformat
updated_at: Date @dateformat
published_at: Date @dateformat
custom_excerpt: String
codeinjection_head: String
codeinjection_foot: String
codeinjection_styles: String
custom_template: String
canonical_url: String
send_email_when_published: Boolean
tags: [GhostTag] @link(from: "tags.slug" by: "slug")
authors: [GhostAuthor]! @link(from: "authors.slug" by: "slug")
primary_author: GhostAuthor! @link(from: "primary_author.slug" by: "slug")
primary_tag: GhostTag @link(from: "primary_tag.slug" by: "slug")
url: String!
excerpt: String
reading_time: Int
email_subject: String
plaintext: String
page: Boolean
og_image: String
og_title: String
og_description: String
twitter_image: String
twitter_title: String
twitter_description: String
meta_title: String
meta_description: String
email_subject: String
}
type GhostTag implements Node {
slug: String!
id: ID!
name: String!
description: String
feature_image: String
visibility: String!
meta_title: String
meta_description: String
url: String!
count: GhostPostCount
postCount: Int
og_image: String
og_title: String
og_description: String
twitter_image: String
twitter_title: String
twitter_description: String
codeinjection_head: String
codeinjection_foot: String
canonical_url: String
accent_color: String
}
type GhostAuthor implements Node {
slug: String!
id: ID!
name: String!
profile_image: String
cover_image: String
bio: String
website: String
location: String
facebook: String
twitter: String
meta_title: String
meta_description: String
url: String!
count: GhostPostCount!
postCount: Int!
}
type GhostSettings implements Node {
title: String
description: String
logo: String
icon: String
cover_image: String
facebook: String
twitter: String
lang: String!
timezone: String!
navigation: [GhostNavigation]
secondary_navigation: [GhostNavigation]
meta_title: String
meta_description: String
og_image: String
og_title: String
og_description: String
twitter_image: String
twitter_title: String
twitter_description: String
url: String!
codeinjection_head: String
codeinjection_foot: String
codeinjection_styles: String!
active_timezone: String
default_locale: String
}
type GhostNavigation {
label: String!
url: String!
}
type GhostPostCount {
posts: Int
}
type GhostTiers implements Node {
id: ID!
name: String!
description: String
slug: String!
active: Boolean!
type: String
welcome_page_url: String
created_at: Date @dateformat
updated_at: Date @dateformat
stripe_prices: String,
monthly_price: Int,
yearly_price: Int,
visibility: String!
}
`;
module.exports = types;