A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
A GraphQL call to the admin API `InventoryItem` query endpoint returns outdated data. We have been able to reproduce this issue across multiple development stores, on 2 consecutive days.
Scenario:
We are stumped by this behaviour, and are forced to conclude this is some sort of error?
Any help in getting this fixed would be most appreciated.
GraphQL query A:
{
inventoryItem(id: "gid://shopify/InventoryItem/44087721754782") {
id
sku
updatedAt
variant {
id
sku
}
countryCodeOfOrigin
provinceCodeOfOrigin
}
}
GraphQL query A response:
{
"data": {
"inventoryItem": {
"id": "gid://shopify/InventoryItem/44087721754782",
"sku": "SMSL-13847-OC-M",
"updatedAt": "2022-09-05T19:33:31Z",
"variant": {
"id": "gid://shopify/ProductVariant/41989857607838",
"sku": "SMSL-13847-OC-M"
},
"countryCodeOfOrigin": "NL",
"provinceCodeOfOrigin": null
}
},
"extensions": {
(...)
}
}
GraphQL query B:
{
productVariant(id: "gid://shopify/ProductVariant/41989857607838") {
id
sku
updatedAt
inventoryItem {
id
sku
updatedAt
countryCodeOfOrigin
provinceCodeOfOrigin
}
}
}
GraphQL query B response:
{
"data": {
"productVariant": {
"id": "gid://shopify/ProductVariant/41989857607838",
"sku": "SMSL-13847-OC-M",
"updatedAt": "2022-09-03T12:42:05Z",
"inventoryItem": {
"id": "gid://shopify/InventoryItem/44087721754782",
"sku": "SMSL-13847-OC-M",
"updatedAt": "2022-09-06T08:55:56Z",
"countryCodeOfOrigin": "GB",
"provinceCodeOfOrigin": null
}
}
},
"extensions": {
(...)
}
}
note: while the queries shown above have been run in the 'Shopify GraphiQL App', we get the same results when querying directly from our own server.
Solved! Go to the solution
This is an accepted solution.
Hi @Jacco-V . We have tested this on some test stores and the updates in Scenario A appear to be registering immediately in our tests. It might have been attributable to some jobs delayed in the database during the period you were testing. If you are still able to replicate you can fill out a bug report form where you can include the details above on how the app in question is interacting with the API such as the request body and headers, as well any response errors and response headers (x-request-id, cursor) from the error and any details of the specific stores so we can investigate them using authenticated secure tools. You can submit this issue using the Report an Issue Form here https://help.shopify.com/en/questions/partners#/contact/report-an-issue it will help expedite the process as this will enable us to authenticate access where necessary. Thank you.
KB77 | API Support @ 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
This is an accepted solution.
Hi @Jacco-V . We have tested this on some test stores and the updates in Scenario A appear to be registering immediately in our tests. It might have been attributable to some jobs delayed in the database during the period you were testing. If you are still able to replicate you can fill out a bug report form where you can include the details above on how the app in question is interacting with the API such as the request body and headers, as well any response errors and response headers (x-request-id, cursor) from the error and any details of the specific stores so we can investigate them using authenticated secure tools. You can submit this issue using the Report an Issue Form here https://help.shopify.com/en/questions/partners#/contact/report-an-issue it will help expedite the process as this will enable us to authenticate access where necessary. Thank you.
KB77 | API Support @ 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