Gatsby Book Launch

“The missing guide to the modern web” launches on Thursday, Sep 29th: Modular: The Web’s New Architecture

ContactSign Up for Free
Community Plugin
View plugin on GitHub

@webriq/gatsby-source-ecwid

Gatsby source plugin for fetching api in ecwid

Install

yarn add @webriq/gatsby-source-ecwid

How to use

// In your gatsby-config.js
plugins: [
    {
      resolve: "@webriq/gatsby-source-ecwid",
      options: {
        storeId: "...",
        token: "...",
        endpoints: {
          EcwidProducts: "/products?limit=100&enbled=true&baseUrl=/&cleanUrls=true",
          EcwidCategories: "/categories?enabled=true&baseUrl=/&cleanUrls=true&hidden_categories=true",
        }
      },
    }
  ],

How to query

You can query Document nodes created from your Ecwid API like the following:

{
  allEcwidProducts {
    nodes {
      id
      name
      price
      description
      imageUrl
    }
  }
}

API Parameters

For more ecwid api parameters visit https://api-docs.ecwid.com/reference/rest-api

© 2022 Gatsby, Inc.