Created
June 12, 2020 18:09
-
-
Save jmolivas/abf5939f735965b813207c0ee9b7443f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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