This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ghost-schema-customization.js
160 lines (157 loc) · 4.47 KB
/
ghost-schema-customization.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
/**
* Here is the place where Gatsby creates schema customizations.
*/
const typeDefs = `
type GhostTag implements Node @dontinfer {
id: String
name: String
slug: String
description: String
feature_image: String
visibility: String
meta_title: String
meta_description: String
postCount: Int
url: String
featureImageSharp: File @link(from: "fields.featureImageSharp")
}
type GhostAuthor implements Node @dontinfer {
id: String
name: String
slug: String
profile_image: String
cover_image: String
bio: String
website: String
location: String
facebook: String
twitter: String
meta_title: String
meta_description: String
postCount: Int
url: String
profileImageSharp: File @link
coverImageSharp: File @link(from: "fields.coverImageSharp")
}
type GhostPost implements Node @dontinfer {
id: String
uuid: String
title: String
slug: String
html: String
comment_id: String
plaintext: String
feature_image: String
featured: Boolean
visibility: String
send_email_when_published: Boolean
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
tags: [GhostTag]
authors: [GhostAuthor]
primary_author: GhostAuthor
primary_tag: GhostTag
url: String
excerpt: String
reading_time: Int
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
featureImageSharp: File @link(from: "fields.featureImageSharp")
childHtmlRehype: HtmlRehype @link
}
type GhostPage implements Node @dontinfer {
id: String
uuid: String
title: String
slug: String
html: String
comment_id: String
plaintext: String
feature_image: 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
tags: [GhostTag]
authors: [GhostAuthor]
primary_author: GhostAuthor
primary_tag: GhostTag
url: String
excerpt: String
reading_time: Int
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
featureImageSharp: File @link(from: "fields.featureImageSharp")
childHtmlRehype: HtmlRehype @link
}
type GhostSettings implements Node @dontinfer {
title: String
description: String
logo: String
icon: String
cover_image: String
facebook: String
twitter: String
lang: String
timezone: String
navigation: [Navigation]
secondary_navigation: [Navigation]
meta_title: String,
meta_description: String,
og_image: String,
og_title: String,
og_description: String,
twitter_image: String,
twitter_title: String,
twitter_description: String,
codeinjection_head: String
codeinjection_foot: String
codeinjection_styles: String
url: String
logoSharp: File @link
iconSharp: File @link
coverImageSharp: File @link(from: "fields.coverImageSharp")
}
type Navigation {
label: String
url: String
}
type HtmlRehype implements Node @dontinfer {
html: String
htmlAst: JSON
tableOfContents: JSON
}
`
const createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions
createTypes(typeDefs)
}
module.exports = createSchemaCustomization