We’re encountering a persistent issue with the Shopify Admin GraphQL API when trying to query inventory items. The error occurs even though we’re using what appears to be a valid GID format.
Error:
javascript
Copy
Error: Variable $id of type ID! was provided invalid value
**Our Setup:
- API Version: 2024-07
- Query:
graphql
query inventoryItem($id: ID!) {
inventoryItem(id: $id) {
id
tracked
sku
}
}
- Sample ID: ‘gid://shopify/InventoryItem/48300333859036’
- Variables passed: { id: ‘gid://shopify/InventoryItem/48300333859036’ }
What we’ve tried:
- Verified GID format is correct
- Confirmed inventory items exist in the store
- Validated API permissions and access
- Double-checked variable passing format
Has anyone encountered this issue before? We’re particularly interested in:
- Any specific formatting requirements for ID variables
- Common causes of this error
- Recommended approaches for handling inventory item queries
Any insights would be greatly appreciated!