I am trying to retrive collection using title but Iam getting error

I am trying to retrive collection using title but Iam getting error

Its_Cherry
New Member
9 0 0

{collections(query:name:Test){edges{node{id,title}}}}

"errors":[{"message":"Parse error on \":\" (COLON) at [1, 24]","locations":[{"line":1,"column":24}]}]

 

 

Can someone help me?

Reply 1 (1)

csam
Shopify Staff (Retired)
267 40 51

Hi @Its_Cherry 

 

A couple corrections for your query - you'll want to use the title field rather name, as name is not a valid field in collection and wrap the query in quotes. Also, you'll need to specify a first or last value in order to limit the number of collections retrieved. Example: 

{
collections(query: "title:TEST", first: 10) {
edges {
node {
id
title
}
}
}
}

Hope this helps!

To learn more visit the Shopify Help Center or the Community Blog.