This repository has been archived by the owner on Nov 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Feature/switch shopify source #57
Open
gil--
wants to merge
4
commits into
master
Choose a base branch
from
feature/switch-shopify-source
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Not using gatsby-source-shopify which is the official one as there seems to be errors on Gatsby v2. Should be a seamless switch in gatsby-plugins.js once it works again. We're switching from the generic graphql-source to a Shopify specific source plugin in order to get the benefits of pagination and imageSharp. This does however have potential issues for larger stores as it retrieves ALL products, ALL collections, ALL images, etc. The graphql-source was easier to limit. Due to how the graphql is structured, there is a considerable number of query structure changes
|
||
allProducts && allProducts.forEach(product => { | ||
allProducts && allProducts.data.allShopifyProduct.edges.forEach(product => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
} | ||
} | ||
} | ||
} | ||
`) | ||
|
||
allCollections && allCollections.data.shopify.shop.collections.edges.forEach(edge => { | ||
allCollections && allCollections.data.allShopifyCollection.edges.forEach(collection => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
gil--
force-pushed
the
feature/switch-shopify-source
branch
from
January 7, 2019 21:52
3c20a7a
to
3acba1e
Compare
Code Climate has analyzed commit 3acba1e and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Due to lack of support for image optimization as well as built in support for querying all products, collections, etc. I’ve decided to switch to a Shopify specific source plugin. There are a number of differences in how queries are structured which resulted in the great number of code changes. There’s definitely some room for refactoring some of the code to reduce dependency on query structure.
We’re usinf ‘gatsby-source-shopify2’ instead of the official one since there are issues with the official Shopify source plugin. Switch between them should be sesmlesss down the line.