GraphQL Syntax Error

Topic summary

Main issue: A Shopify Admin GraphQL query fails with “syntax error, unexpected STRING (", ")”. The error appears when requesting inventoryItem.inventoryLevels.quantities with names [“available”, “on_hand”, “reserved”, “committed”].

Key detail: Removing the quantities field makes the query succeed. The posted query also includes the deprecated ProductVariant.inventoryManagement field.

Latest suggestion: Remove the deprecated inventoryManagement field from ProductVariant and test again (link to Shopify docs provided). “Deprecated” means the field is no longer recommended and may be removed in future versions.

Status: No confirmation yet whether removing inventoryManagement resolves the syntax error; discussion remains open. The code snippet is central to understanding the issue.

Summarized with AI on January 6. AI used: gpt-5.

Hey there,

I got this error:

syntax error, unexpected STRING (\", \") 

after I use the following query:

query ProductsQuery($cursor: String) {
products(first: 1000, after: $cursor) {
edges {
node {
__typename
id
variants {
edges {
node {
__typename
id
... on ProductVariant {
inventoryQuantity
inventoryPolicy
inventoryManagement
inventoryItem {
id
requiresShipping
tracked
inventoryLevels {
edges {
node {
id
location {
id
}
quantities(names: ["available", "on_hand", "reserved", "committed"]) {
name
quantity
}
}
}
}
}
}
}
}
}
}
}
pageInfo {
hasNextPage
endCursor
}
}
}

I am a beginner in GraphQL and I tried to find all the available solutions, but nothing worked successfully.

If I remove:

quantities(names: ["available", "on_hand", "reserved", "committed"]) {
name
quantity
}

The query will run normally, but I need the quantities for my tasks. Can anybody please help me with this error?

And I’m sorry if the way that I asked doesn’t satisfy you.

Thank you.

Hi Alinh1803,

The inventoryManagement field on ProductVariant is deprecated - if you remove this, is it working?