Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-source-spree

This source plugin for Gatsby will make products from Spree available in GraphQL queries.

Installation

# Install the plugin
yarn add gatsby-source-spree

In gatsby-config.js:

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-source-spree',
      options: {
        host: 'http://localhost:3000'
      }
    }
  ]
};

Querying Spree Products

Once the plugin is configured, the query is available in GraphQL: allSpreeProducts

Here’s an example query to load 10 images:

{
  allSpreeProducts{
    edges {
      node {
        attributes{
          name
          price
          purchasable
        }
      }
    }
  }
}
© 2023 Gatsby, Inc.