Skip to content

Instantly share code, notes, and snippets.

@jmolivas
Created June 12, 2020 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmolivas/abf5939f735965b813207c0ee9b7443f to your computer and use it in GitHub Desktop.
Save jmolivas/abf5939f735965b813207c0ee9b7443f to your computer and use it in GitHub Desktop.
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