Support for ProductCollectionSortKeys and ProductImageSortKeys #32097
Replies: 4 comments 1 reply
-
+1 for this, @ jc745 did manage a way to sort the images in a way that reflects Shopify admin? |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
Hi there, we're currently testing the next major version of gatsby-source-shopify. This may address your issue. Learn more about upgrading: https://www.notion.so/gatsbyjs/Instructions-for-upgrading-to-Shopify-7-e5cb1068b35b4de7ba7e9ffb160aad26 |
Beta Was this translation helpful? Give feedback.
-
Do you have any suggestions on how to solve this? Upgrading to 7 or 8 still doesn't include a way to order the images. |
Beta Was this translation helpful? Give feedback.
-
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 thePOSITION
value would be sufficient?Example queries:
Beta Was this translation helpful? Give feedback.
All reactions