Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ProductCollectionSortKeys and ProductImageSortKeys #32065

Closed
jc745 opened this issue Apr 16, 2021 · 0 comments
Closed

Support for ProductCollectionSortKeys and ProductImageSortKeys #32065

jc745 opened this issue Apr 16, 2021 · 0 comments
Labels
topic: source-shopify Related to the gatsby-source-shopify plugin

Comments

@jc745
Copy link

jc745 commented Apr 16, 2021

Adding support for ProductCollectionSortKeys and ProductImageSortKeys would be welcome additions.

ProductCollectionSortKeys

You can imagine a situation where filtering collections of products on the frontend becomes much more feasible using ProductCollectionSortKeys (mentioned in gatsbyjs/gatsby-source-shopify#112).

ProductImageSortKeys

In (limited) testing it seems that Shopify's Admin API returns product images out of their natural order, whereas the Storefront API returns them in their natural order, based on how the product's images are positioned in the Shopify Admin UI.

Implementing ProductImageSortKeys would allow for proper ordering when using the Admin API, though I think defaulting to the POSITION value would be sufficient?

Example queries:

ProductCollectionSortKeys

query {
  collectionByHandle(handle: "classic"){
    products(first: 10, sortKey: BEST_SELLING) {
      ...
    }
  }
}
ProductImageSortKeys

query {
  productByHandle(handle: "snare-boot") {
    images(sortKey: POSITION) {
      ...
    }
  }
}

@DanielSLew DanielSLew transferred this issue from gatsbyjs/gatsby-source-shopify Jun 23, 2021
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jun 23, 2021
@LekoArts LekoArts added topic: source-shopify Related to the gatsby-source-shopify plugin and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jun 23, 2021
@gatsbyjs gatsbyjs locked and limited conversation to collaborators Jun 23, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
topic: source-shopify Related to the gatsby-source-shopify plugin
Projects
None yet
Development

No branches or pull requests

2 participants