GithubHelp home page GithubHelp logo

gatsby-source-bigcommerce's People

Contributors

boggsey avatar dependabot[bot] avatar grantglidewell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

gatsby-source-bigcommerce's Issues

Not compatible with gatsby v3

When developing with this plugin activated and a gatsby v3 site, I get the following warnings:

warn Plugin gatsby-source-bigcommerce is not compatible with your gatsby version 3.10.1 - It requires gatsby@^2.0.0
warn Plugin gatsby-source-bigcommerce is not compatible with your gatsby version 3.10.1 - It requires gatsby@^2.0.0

No data

Hey,

Thanks for taking the time to build this. I'm having trouble getting this to work.

I have configured as per the readme, but for some reason, it's not pulling in any data. allBigCommerceNode is not visible is the graphiQl interface.

Do you know the best way to debug this?

Cheers

the plugin doesn't load past the first page

Using the endpoint /catalog/products?include=modifiers causes BigCommerce to limit the API response to 10 entries and, in a store with more than 10 entries, the extra pages are never loaded.

Also, inspecting the code I noticed that the same would happen in a store with more than 50 items on the catalog.

Also, there is a bug on BC API where they cut the number of entries from 50 to 10 but they do not update the meta.pagination response. It looks like the following:

    "meta": {
        "pagination": {
            "total": 30,
            "count": 10,
            "per_page": 50,
            "current_page": 1,
            "total_pages": 1,
            "links": {
                "current": "?include=modifiers&page=1&limit=50"
            },
            "too_many": false
        }
    }

This can be solved by adding the correct limit to the API call, for example /catalog/products?include=modifiers&limit=10, in which case the response becomes:

    "meta": {
        "pagination": {
            "total": 30,
            "count": 10,
            "per_page": 10,
            "current_page": 1,
            "total_pages": 3,
            "links": {
                "next": "?include=modifiers&limit=10&page=2",
                "current": "?include=modifiers&limit=10&page=1"
            },
            "too_many": false
        }
    }

I'll try something but can't promise a fix.

Cheers!

Support for gatsby images

Do you think that there will be any support for gatsby images?

I tried implementing this myself but I'm not super familiar with creating nodes in gatsby.

Respect BigCommerce response pagination

Motivation and context

Gatsby needs to collect all the data from the source for correct GraphQL work (including sorting and filtering). Current implementation returns 50 items at most because BigCommerce API designed this way. For collecting the next portion of the data (next 50 items) from BigCommerce, an additional ?page=${nextPageNumber} query parameter needs to be added to the API request.

This change is required for projects that have in BigCommerce more than 50 items in products, categories, product variants, etc. in order to be able to build a Gatsby site with the correct amount of data retrieved from BigCommerce.

How has this been tested?

I've done the following on current plugin implementation:

  • Created 1'000+ categories using BigCommerce API
  • Added new endpoint with categories:
      {
        resolve: 'gatsby-source-bigcommerce',
        options: {
        ...
          endpoints: {
            BigCommerceCategories: "/catalog/categories",
          }
        }
      },
  • Opened Gatsby's GraphiQL interface at http://localhost:8000/___graphql
  • Ran following query:
    query AllCategories {
      allBigCommerceCategories {
        totalCount
      }
    }

Actual behavior

Response with only 50 items:

{
  "data": {
    "allBigCommerceCategories": {
      "totalCount": 50
    }
  }
}

Expected behavior

Get count of all my BigCommerce categories:

{
  "data": {
    "allBigCommerceCategories": {
      "totalCount": 1024
    }
  }
}

Proposed solution

I've created Pull Request: #18

BigCommerce GraphQL API Question

Thanks for all of your work on gatsby-source-bigcommerce! I've been using it for a few days now and found it to be very helpful.

I'm just now looking into BigCommerce's GraphQL API, which is currently in BETA. It looks like it's going to be able to provide a ton of useful things like product imagery and in-depth site data, etc.

In order to use the BigCommerce GraphQL API and integrate it into Gatsby's GraphQL, you have to generate a storefront token and then use something gatsby-source-graphql.

I'm wondering if you have put any thought into BigCommerce's GraphQL API and how it might affect gatsby-source-bigcommerce. It seems like they could co-exist if gatsby-source-bigcommerce can handle generating the Storefront API token. Not sure if that is something that you would want to pursue though. Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.