JSPM

  • Created
  • Published
  • Downloads 8556
  • Score
    100M100P100Q129589F
  • License MIT

Gatsby source plugin for building websites using Strapi as a data source

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