I'm pulling in data from Strapi, a CMS, using a query in GraphiQL. Everything works fine as below:
query MyQuery {
allStrapiPortfolioPages {
nodes {
order
}
}
}
with the response:
{
"data": {
"allStrapiPortfolioPages": {
"nodes": [
{
"order": 1
},
{
"order": 2
},
{
"order": 3
}
]
}
},
"extensions": {}
}
I try to sort the data as below:
query MyQuery {
allStrapiPortfolioPages(sort: {order: ASC}) {
nodes {
order
}
}
}
This leads to an error with the message: "Cannot read property 'map' of undefined".
How do I sort these nodes in my query?