Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Title.
The
productRecommendations(productId: "productId", intent: COMPLEMENTARY) {
graphql call returns correct information, except for the title and description of the complementary products.
The title and the description are instead of the main products, which is a bit weird.
Any ideas, solutions?
HI Koffein,
If you're getting unexpected results when using the `productRecommendations` query in Shopify's GraphQL API, it could be due to a misinterpretation of the query structure. Specifically, you should ensure that you're structuring your query correctly to access the properties of the recommended products. Can you share the full query?
Hope this helps,
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hey Liam,
While prepping to answer you, I found the problem 🦆
The localization of the mock products in our shop was not complete and I was getting the wrong data from the correct product, but only because someone put it there (or did not update the translations).
Thanks for the help anyway! 😬
No worries! This is easy to happen - glad you figured it out!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi @Liam
Can you let me know if complementary products on the Hydrogen store are the one which will be based on the configuration in admin or these products are generated by Shopify and displayed. Because I have configured different products in the Search and Discovery app but when I run the query I get other products.
Here is the query for same: