gatsby-source-drupal-graphql

Source plugin for pulling data (including images) into Gatsby from Drupal sites.

Pulls data from Drupal sites with the Drupal GraphQL module installed.

Install

Using npm

npm install --save gatsby-source-drupal-graphql

Using yarn

yarn add gatsby-source-drupal-graphql

How to use

Default configuration

{
  resolve: `gatsby-source-drupal-graphql`,
  options: {
    drupal: {
      url: process.env.DRUPAL_URL,
      auth: {
        // Use as String
        token: process.env.DRUPAL_AUTH_TOKEN,
        // Use as Function
        token: login.fetchOauthToken(
          process.env.DRUPAL_URL,
          process.env.DRUPAL_AUTH_USERNAME,
          process.env.DRUPAL_AUTH_PASSWORD,
          process.env.DRUPAL_AUTH_CLIENT_ID
        ),
      },
      development: {
        query_limit: process.env.DRUPAL_DEVELOPMENT_QUERY_LIMIT,
        image_placeholder: process.env.DRUPAL_DEVELOPMENT_IMAGE_PLACEHOLDER,
      },
      exclude_media_extensions: ['gif', 'pdf'],
    },
    environment: process.env.NODE_ENV,
  },
},