npm

Need private packages and team management tools?Check out npm Orgs. »

gatsby-source-strapi

0.0.9 • Public • Published

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
      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
      }
    }
  }
}

install

npm i gatsby-source-strapi

Downloadsweekly downloads

4,156

version

0.0.9

license

MIT

homepage

strapi.io

repository

Gitgithub

last publish

collaborators

  • avatar
  • avatar
  • avatar
  • avatar
Report a vulnerability