What's your biggest current challenge? Have your say in Community Polls along the right column.

Different Results GraphiQL vs Postman vs Python Request

Solved

Different Results GraphiQL vs Postman vs Python Request

max15characters
Tourist
4 1 2

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?

Accepted Solution (1)

Kyle_liu
Shopify Partner
287 38 51

This is an accepted solution.

Hi @max15characters 

 

Please check if the version of the API used for GraphiQL vs Postman vs Python Request is consistent.

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee

View solution in original post

Replies 2 (2)

Kyle_liu
Shopify Partner
287 38 51

This is an accepted solution.

Hi @max15characters 

 

Please check if the version of the API used for GraphiQL vs Postman vs Python Request is consistent.

If this is helpful, please Like and Accept the solution.
Want to modify or custom changes on store? Let me help.
- Feel free to contact me Email Me Buy Me A Coffee
max15characters
Tourist
4 1 2

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?