Skip to content

Instantly share code, notes, and snippets.

@ashhitch
Created June 8, 2021 14:21
Show Gist options
  • Save ashhitch/2f005bbcb73abb4d0eb4833af32cfe38 to your computer and use it in GitHub Desktop.
Save ashhitch/2f005bbcb73abb4d0eb4833af32cfe38 to your computer and use it in GitHub Desktop.
Gatsby Image in GraphQL toolkit
exports.createResolvers = function({ actions,cache,createNodeId,createResolvers,store,reporter }) {
const { createNode } = actions;
createResolvers({
HATCH_ContentMediaItemType: {
imageFile: {
type: `File`,
resolve(source, args, context, info) {
return createRemoteFileNode({
url: source.filePath,
store,
cache,
createNode,
createNodeId,
reporter,
})
},
},
},
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment