0.5.1 • Published 4 years ago

gatsby-source-sylius-rest v0.5.1

Weekly downloads
10
License
MIT
Repository
-
Last release
4 years ago

CI

Description

gatsby-source-sylius-rest helps you source the data from Sylius e-Commerce framework. It sources all necessary data and creates localized pages for you.

Learning Resources

This source plugin uses API provided by SyliusShopApi bundle.

Documentation

Please check full docs here.

How to install

Using yarn:

yarn add gatsby-source-sylius-rest

or npm:

npm install --save gatsby-source-sylius-rest

Examples of usage

Add plugin configuration to your gatsby-config.js:

module.exports = {
  plugins: [
    // plugins
    {
      resolve: 'gatsby-source-sylius-rest',
      options: {
        locales: ['en', 'de'],
        url: 'https://your-sylius-shop.com/shop-api',
        pages: [
          {
            component: require.resolve('./src/templates/SyliusTaxonPage.tsx'),
            type: 'taxon',
          },
          {
            component: require.resolve('./src/templates/SyliusProductPage.tsx'),
            type: 'product',
            path: {
              de: '/:locale/produkt/:slug',
              en: '/:locale/product/:slug',
            },
          },
        ],
        schemas: {
          product: {
            variantSelectionMethod: 'String!',
          },
        },
      },
    },
  ],
};

Options

Plugin options

Please check SyliusSourcePluginOptionsInterface definition for TypeScript interface.

NameRequiredTypeDescription
debugnobooleanProvides additional messages during Gatsby build
limitsnoSyliusSourcePluginLimitsRows limits used for pagination for specific calls to Sylius Shop API.
localesyesstring[]List of supported locales. They are required for retrieving data from Sylius API, sourcing GraphQL nodes and link building.
pagesnoSyliusSourcePluginPageDefinition[]Definitions of pages which should be created using Gatsby Node API (createPages). If empty, gatsby-source-sylius-rest will not create pages.
schemasnoSyliusSourcePluginSchemasDefinitions of additional or overriden fields in schemas that will be sourced.
urlyesstringURL to the Sylius shop API.

How to run tests

Write yarn run test in terminal or use launch configurations in your Visual Studio Code.

TODO

  1. Source products attributes.
  2. Source product variant images.
  3. Source latest products.
0.5.1

4 years ago

0.5.0

4 years ago

0.4.0

4 years ago

0.4.0-dev.4

4 years ago

0.4.0-dev.3

4 years ago

0.4.0-dev.2

4 years ago

0.4.0-dev.1

4 years ago

0.3.0

4 years ago

0.3.1

4 years ago

0.3.0-dev.0

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.2.0-dev.3

4 years ago

0.2.0-dev.2

4 years ago

0.2.0-dev.1

4 years ago

0.2.0-dev.0

4 years ago

0.1.6

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.5

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago