Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
exports.createResolvers = ({ actions, getCache, createNodeId, createResolvers }) => {
const { createNode } = actions
createResolvers({
Drupal_MediaImage: {
gatsbyImageFile: {
type: `File`,
resolve(source) {
return createRemoteFileNode({
url: source.fieldMediaImage.url,
getCache,
createNode,
createNodeId,
httpHeaders: {
Authorization: `Basic ${process.env.DRUPAL_AUTH_TOKEN}`,
},
})
},
},
},
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment