This plugin sources the strapi-plugin-navigation.
It support custom names and independent navigation types per navigation.
yarn:
yarn add gatsby-source-strapi-plugin-navigation-v3
npm:
npm install gatsby-source-strapi-plugin-navigation-v3
// gatsby-config.js
{
resolve: "gatsby-source-strapi-plugin-navigation-v3",
options: {
apiURL: process.env.STRAPI_API_URL,
navigations: [
// array of navigation end-points
{
name: "MainNavigation", // optional
slugOrId: "navigation",
type: "tree"
},
],
token: process.env.STRAPI_TOKEN,
// Optional, useful when navigation subitems are optional
schemaForOptionalRelatedFields: `
slug: String
title: String
`
},
}
Edited plugin gatsby-source-strapi-plugin-navigation-v2 for own purposes.