0.0.31 • Published 6 years ago
gatsby-source-strapi-local-fields v0.0.31
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`,
queryLimit: 1000, // Default to 100
preprocessNodes: (allEntities) => undefined, // default to null
contentTypes: [`article`, `user`],
//If using single types place them in this array.
singleTypes: [`home-page`, `contact`],
// Possibility to login with a strapi user, when content types are not publically available (optional).
loginData: {
identifier: "",
password: "",
},
},
},
]How to query
You can query Document nodes created from your Strapi API like the following:
{
allStrapiArticle {
edges {
node {
id
title
content
}
}
}
}To query images you can do the following:
{
allStrapiArticle {
edges {
node {
id
singleImage {
publicURL
}
multipleImages {
localFile {
publicURL
}
}
}
}
}
}0.0.31
6 years ago
0.0.30
6 years ago
0.0.28
6 years ago
0.0.29
6 years ago
0.0.24
6 years ago
0.0.25
6 years ago
0.0.26
6 years ago
0.0.27
6 years ago
0.0.21
6 years ago
0.0.22
6 years ago
0.0.23
6 years ago
0.0.20
6 years ago
0.0.19
6 years ago
0.0.18
6 years ago
0.0.17
6 years ago
0.0.16
6 years ago
0.0.13
6 years ago
0.0.14
6 years ago
0.0.15
6 years ago
0.0.12
6 years ago