Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.
/ gatsby-source-chec Public archive

Chec and Commerce.js Gatsby source plugin. Fetch eCommerce data from the Chec API.

License

Notifications You must be signed in to change notification settings

chec/gatsby-source-chec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a60b4eb · Jun 3, 2022

History

63 Commits
Oct 4, 2021
Dec 1, 2021
Jun 3, 2022
Jun 30, 2021
Apr 6, 2020
Apr 1, 2020
Mar 30, 2020
Mar 30, 2020
Apr 7, 2020
Mar 30, 2020
Oct 4, 2021
Dec 1, 2021

Repository files navigation

@chec/gatsby-source-chec

🛍 Gatsby plugin for sourcing products, categories and merchant info from your Chec store.

Install

yarn add @chec/gatsby-source-chec # npm install @chec/gatsby-source-chec

Config

// In your gatsby-config.js
plugins: [
  {
    resolve: `@chec/gatsby-source-chec`,
    options: {
      publicKey: '...',
      downloadImageAssets: true, // false by default
    },
  },
];

Usage

{
  checMerchant {
    id
    business_name
  }

  allChecCategory {
    nodes {
      name
      slug
      description
      created
      id
    }
  }

  allChecProduct {
    nodes {
      id
      name
      price {
        formatted_with_symbol
      }
    }
  }
}

Downloading image assets

This plugin provides you the option to download product asset images, and cache them in your Gatsby project. This works great with gatsby-plugin-image.

Add downloadImageAssets: true to your plugin options.

These assets will be added as images to the product nodes.

  product: checProduct(id: { eq: $id }) {
    id
    name
    price {
      formatted_with_symbol
    }
    images {
      childImageSharp {
        gatsbyImageData
      }
    }
  }

⚠️ Note

This repository is no longer maintained

However, we will accept issue reports and contributions for this repository. See the contribute to the commerce community page for more information on how to contribute to our open source projects. For update-to-date APIs, please check the latest version of the API documentation.