With some additional functions.
Source plugin for pulling documents into Gatsby from prismic.io repositories.
npm install --save gatsby-source-prismic
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-source-prismic`,
options: {
repositoryName: `your_repository_name`,
accessToken: `your_acces_token`,
},
},
]
You can query Document nodes created from prismic.io like the following:
{
allPrismicDocument {
edges {
node {
id
data {
title {
type
text
}
}
}
}
}
}