Source plugin for pulling data into Gatsby from a Directus API.
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.
npm install gatsby-source-directus@4
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
},
},
],
};
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.