-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgatsby-node.js
40 lines (38 loc) · 1.01 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
const createPosts = require('./create/createPosts')
const createPages = require('./create/createPages')
const createCategories = require('./create/createCategories')
const createUsers = require('./create/createUsers')
const { createRemoteFileNode } = require(`gatsby-source-filesystem`)
exports.createPages = async ({ actions, graphql }) => {
await createPosts({ actions, graphql })
await createPages({ actions, graphql })
await createCategories({ actions, graphql })
await createUsers({ actions, graphql })
}
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,
})
},
},
},
})
}