-
Notifications
You must be signed in to change notification settings - Fork 0
/
createSchemaCustomization.ts
54 lines (50 loc) · 1.26 KB
/
createSchemaCustomization.ts
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
import { CreateSchemaCustomizationArgs, GatsbyNode } from 'gatsby'
export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] = async ({
actions,
}: CreateSchemaCustomizationArgs): Promise<any> => {
const { createTypes } = actions
// language=GraphQL
const typeDefs = `
type EsaPost implements Node {
team: String!
number: Int!
name: String!
full_name: String!
wip: Boolean!
body_md: String!
body_html: String!
created_at: Date! @dateformat
message: String!
kind: String!
comments_count: Int!
tasks_count: Int!
done_tasks_count: Int!
url: String!
updated_at: Date! @dateformat
tags: [String!]!
category: String!
revision_number: Int!
created_by: EsaPostUser!
updated_by: EsaPostUser!
stargazers_count: Int!
watchers_count: Int!
star: Boolean!
watch: Boolean!
}
type EsaPostBodyHtml implements Node {
team: String!
html: String!
content: String!
}
type EsaPostBodyMarkdown implements Node {
team: String!
content: String!
}
type EsaPostUser {
name: String!
screen_name: String!
icon: String!
}
`
createTypes(typeDefs)
}