Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I don't know what label should I choose for this, so please forgive me.
I encountered a really bizarre problem, where API request results differ between GraphiQL, Postman and via Python Request.
Request:
{ product(id: "gid://shopify/Product/7161071599788") { variants(first: 10) { edges { node { unitPriceMeasurement { quantityValue } } } } } }
GraphiQL result (this is what I'm after):
{ "data": { "product": { "variants": { "edges": [ { "node": { "unitPriceMeasurement": { "quantityValue": 1.44 } } } ] } } }, "extensions": { "cost": { "requestedQueryCost": 11, "actualQueryCost": 5, "throttleStatus": { "maximumAvailable": 4000, "currentlyAvailable": 3995, "restoreRate": 200 } } } }
Postman result:
{ "errors": [ { "message": "Field 'unitPriceMeasurement' doesn't exist on type 'ProductVariant'", "locations": [ { "line": 11, "column": 21 } ], "path": [ "query", "product", "variants", "edges", "node", "unitPriceMeasurement" ], "extensions": { "code": "undefinedField", "typeName": "ProductVariant", "fieldName": "unitPriceMeasurement" } } ] }
Python Response result:
{ 'data': { 'product': None } }
All using the same API version and token.
I'm not too worried about Postman, but in Python this only happen with 2 products (what I've tested so far).
Can anyone enlighten me?
Solved! Go to the solution
This is an accepted solution.
Please check if the version of the API used for GraphiQL vs Postman vs Python Request is consistent.
This is an accepted solution.
Please check if the version of the API used for GraphiQL vs Postman vs Python Request is consistent.
Thanks Kyle, while that wasn't the issue, I tried sending the request using admin API 2024-10 instead of storefront API and now it works everywhere.
It's been working well with storefront API since March, and it only started spitting issues just now. Maybe it was deprecated?
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024