Package Exports
- gatsby-source-strapi
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gatsby-source-strapi) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
gatsby-source-strapi
Source plugin for pulling documents into Gatsby from a Strapi API.
Install
npm install --save gatsby-source-strapi
How to use
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-source-strapi`,
options: {
apiURL: `http://localhost:1337`,
contentTypes: [
`article`,
`user`
]
},
},
]
How to query
You can query Document nodes created from your Strapi API like the following:
{
allStrapiArticle {
edges {
node {
id
title
content
}
}
}
}