gatsby-source-spree
v1.0.0
Published
A Gatsby source plugin to load resources from the Spree API
Downloads
4
Maintainers
Readme
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
}
}
}
}
}