Gatsby Source Directus screenshot

Gatsby Source Directus

Author Avatar Theme by Directus
Updated: 19 Sep 2023
11 Stars

Source plugin for pulling data into Gatsby from a Directus API.

Categories

Overview:

The gatsby-source-directus is a source plugin that allows users to pull data from a Directus API into the Gatsby GraphQL Data Layer. It provides a convenient way to access and query data from a Directus instance within a Gatsby project.

Features:

  • Pulls data from a Directus API into the Gatsby GraphQL Data Layer
  • Supports both gatsby@4 and gatsby@5 versions
  • Provides options for authentication and access to non-public content
  • Allows customization of GraphQL type and field names for user-defined collections and Directus-defined collections
  • Offers options for development environments, including refreshing the schema and configuring image download concurrency

Installation:

For Gatsby 4:

npm install gatsby-source-directus@4

For Gatsby 5:

npm install gatsby-source-directus@5

Add the package to your gatsby-config.js file in your Gatsby project:

module.exports = {
  plugins: [
    {
      resolve: "gatsby-source-directus",
      options: {
        url: "https://your-directus-api-url.com",
        // other configuration options
      },
    },
  ],
};

Summary:

The gatsby-source-directus plugin is a useful tool for integrating Directus API data into a Gatsby project. With its support for both gatsby@4 and gatsby@5 versions, authentication options, customizable GraphQL type and field names, and development environment configurations, it provides flexibility and convenience for developers working with Gatsby and Directus.