Gatsby: problem on sorting with graphql

Created on 29 Nov 2017  路  5Comments  路  Source: gatsbyjs/gatsby

I try something like this:
allImageSharp (sort: {fields:id}){
edges {
node {
sizes {
src
originalImg
originalName
}
}
}
}

it works on the graphiQL web window but when I put it in my gatsby it says
GraphQLError: Argument "sort" has invalid value {fields: "id"}.
In field "fields": Expected type "ImageSharpConnectionSortByFieldsEnum", found "id".

Any ideas ? Thanks.

documentation question or discussion

Most helpful comment

Ok I've found it :
allImageSharp (sort: {fields: [id]})
Enjoy...

All 5 comments

Ok I've found it :
allImageSharp (sort: {fields: [id]})
Enjoy...

Thank uuuuuuuu @pinaudnico

Is this documented anywhere? I couldn't find it even with the new docs search. :)

I've found it experimenting...

@pinaudnico THANK YOU.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benstr picture benstr  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

jimfilippou picture jimfilippou  路  3Comments

totsteps picture totsteps  路  3Comments

magicly picture magicly  路  3Comments