-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgatsby-node.ts
84 lines (76 loc) · 1.67 KB
/
gatsby-node.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
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
import { GatsbyNode } from "gatsby";
import * as path from "path";
export const onCreateWebpackConfig = ({ actions }) => {
actions.setWebpackConfig({
resolve: {
alias: {
"@/components": path.resolve(__dirname, "src/components"),
"@/lib/utils": path.resolve(__dirname, "src/components/lib/utils"),
"@/utils": path.resolve(__dirname, "src/utils"),
},
},
});
};
export const createSchemaCustomization: GatsbyNode["createSchemaCustomization"] =
({ actions }) => {
actions.createTypes(`
type DrpdJson implements Node @childOf(types: ["File", "Json"]) {
version: String!
uuid: String!
label: String!
title: String
authors: [String!]
date: String!
waves: [Wave!]!
starters: [Pokemon!]!
}
type Wave {
id: String!
reload: Boolean!
type: String!
double: Boolean!
actions: [String!]!
shop: String!
biome: String!
trainer: Trainer
pokemon: [Pokemon!]
}
type Pokemon {
id: Int!
name: String!
ability: String!
isHiddenAbility: Boolean!
passiveAbility: String!
nature: Nature!
gender: String!
rarity: String!
captured: Boolean!
level: Int!
items: [Item!]!
ivs: Ivs!
}
type Nature {
name: String!
increased: String!
decreased: String!
}
type Ivs {
hp: Int!
atk: Int!
def: Int!
spatk: Int!
spdef: Int!
spe: Int!
}
type Item {
id: String!
name: String!
quantity: String!
}
type Trainer {
id: String!
name: String!
type: String!
}
`);
};