gatsby-source-spree

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i gatsby-source-spree

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

2.36 kB

Total Files

3

Last publish

Collaborators

  • alyreza