-
Notifications
You must be signed in to change notification settings - Fork 3
/
gatsby-node.js
44 lines (41 loc) · 1.18 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
const createPosts = require(`./create/createPosts`)
const createPages = require(`./create/createPages`)
const createCategories = require(`./create/createCategories`)
const createTags = require(`./create/createTags`)
const createUsers = require(`./create/createUsers`)
exports.createPages = async ({ actions, graphql }) => {
await createPosts({ actions, graphql })
await createPages({ actions, graphql })
await createCategories({ actions, graphql })
await createTags({ actions, graphql })
await createUsers({ actions, graphql })
}
// Pull featured images into the project statically to serve them with gatsby-image
const { createRemoteFileNode } = require(`gatsby-source-filesystem`)
exports.createResolvers = ({
actions,
cache,
createNodeId,
createResolvers,
store,
reporter,
}) => {
const { createNode } = actions
createResolvers({
WPGraphQL_MediaItem: {
imageFile: {
type: `File`,
resolve(source, args, context, info) {
return createRemoteFileNode({
url: source.sourceUrl,
store,
cache,
createNode,
createNodeId,
reporter,
})
},
},
},
})
}