Skip to content

A Gatsby source plugin to load resources from the Spree API

Notifications You must be signed in to change notification settings

ALYREZA/gatsby-source-spree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gatsby-source-spree

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

Installation

# Install the plugin with yarn
yarn add gatsby-source-spree

# or with npm
npm install gatsby-source-spree --save

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

{
  allSpreeProducts{
    edges {
      node {
        attributes{
          name
          price
          purchasable
        }
      }
    }
  }
}

About

A Gatsby source plugin to load resources from the Spree API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published