-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-node.js
105 lines (102 loc) · 2.47 KB
/
gatsby-node.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
exports.createPages = ({ graphql, actions }) => {
const { createRedirect } = actions
createRedirect({
fromPath: "/sponsor",
toPath: "/sponsor.pdf",
isPermanent: true,
})
createRedirect({
fromPath: "/promo",
toPath:
"https://docs.google.com/document/d/1ly4fqNVvxZSvoVW3NTE5NoVtvD6nj2czLc7J1EUbNtY/edit?usp=sharing",
})
createRedirect({
fromPath: "/waiver",
toPath: "/waiver.pdf",
isPermanent: true,
})
}
exports.createSchemaCustomization = ({ actions, schema }) => {
const { createTypes } = actions
const buildPersonType = name => {
return schema.buildObjectType({
name,
fields: {
name: {
type: "String!",
},
position: {
type: "String",
},
company: {
type: "String",
},
imageLink: {
type: "String",
},
},
interfaces: ["Node"],
})
}
const typeDefs = [
buildPersonType("GoogleSpreadsheetSpeakers"),
buildPersonType("GoogleSpreadsheetRecruiters"),
buildPersonType("GoogleSpreadsheetJudges"),
schema.buildObjectType({
name: "GoogleSpreadsheetSchedule",
fields: {
day: {
type: "Int!",
},
name: {
type: "String!",
},
type: {
type: "String!",
},
startTime: {
type: "String!",
resolve: source => (source.startTime == null ? "" : source.startTime),
},
endTime: {
type: "String!",
resolve: source => (source.endTime == null ? "" : source.endTime),
},
description: {
type: "String!",
resolve: source =>
source.description == null ? "" : source.description,
},
company: {
type: "String!",
resolve: source => (source.company == null ? "" : source.company),
},
prize: {
type: "String!",
resolve: source => (source.prize == null ? "" : source.prize),
},
},
interfaces: ["Node"],
}),
schema.buildObjectType({
name: "GoogleSpreadsheetSponsors",
fields: {
tier: {
type: "String!",
},
link: {
type: "String!",
},
image: {
type: "String!",
},
alt: {
type: "String!",
resolve: source => (source.alt == null ? "" : source.alt),
},
},
interfaces: ["Node"],
}),
]
createTypes(typeDefs)
}