@webriq/gatsby-source-strapi

0.0.6 • Public • Published

gatsby-source-strapi

Source plugin for pulling documents into Gatsby from a Strapi API.

Install

npm install --save @webriq/gatsby-source-strapi

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-source-strapi`,
    options: {
      apiURL: `http://localhost:1337`,
      contentTypes: [`article`, `user`],
      // 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
      }
    }
  }
}

Package Sidebar

Install

npm i @webriq/gatsby-source-strapi

Homepage

strapi.io

Weekly Downloads

1

Version

0.0.6

License

MIT

Unpacked Size

21.6 kB

Total Files

10

Last publish

Collaborators

  • webriq