Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

GraphQL Syntax Error

GraphQL Syntax Error

alinh1803
Shopify Partner
1 0 0

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.

 
Reply 1 (1)

Liam
Community Manager
3108 344 894

Hi Alinh1803,

 

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

Liam | Developer Advocate @ 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