A source plugin for Gatsby that pulls data from Drupal 7.
This source plugin has been forked from gatsby-source-drupal to extend functionality to Drupal 7.
Drupal 7 site with the following modules installed and enabled:
npm install --save gatsby-source-drupal7
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-source-drupal7`,
options: {
baseUrl: `https://live-mydrupal7site.pantheonsite.io/`,
apiBase: `restws_resource.json`, // optional, defaults to `restws_resource.json`
},
},
],
}
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-source-drupal7`,
options: {
baseUrl: `https://live-mydrupal7site.pantheonsite.io/`,
apiBase: `restws_resource.json`, // optional, defaults to `restws_resource.json`
basicAuth: {
username: process.env.BASIC_AUTH_USERNAME,
password: process.env.BASIC_AUTH_PASSWORD,
},
},
},
],
}
{
allNode {
edges {
node {
data {
title
created
body {
value
}
}
}
}
}
}