# Can't use graphQuery sortBy

**URL:** <https://community.prismic.io/t/cant-use-graphquery-sortby/8571>\
**Category:** Developing with Prismic\
**Tags:** rest-api\
**Created:** [January 9, 2022, 1:06am UTC](https://community.prismic.io/t/cant-use-graphquery-sortby/8571 "2022-01-09T01:06:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sean1](https://avatars.discourse-cdn.com/v4/letter/s/c77e96/32.png) [@sean1](https://community.prismic.io/u/sean1)\
**Post date:** [January 9, 2022, 1:06am UTC](https://community.prismic.io/t/cant-use-graphquery-sortby/8571/1 "2022-01-09T01:06:17Z")

</div>

I have a custom repeatable type called 'event'. I nee to grab a few fields for a listing page and my query is this:

`{ allEvents{ edges{ nodes{ title state city logo uid date } } } }`

and I want to do a sortBy on the date as such:

`{ allEvents(sortBy:date_ASC){ edges{ nodes{ title state city logo uid date } } } }`

the first query works, the second always gives me a CORS issue.

Any ideas? Also, it would be really great if your documentation for Vue/Nuxt had some examples of sorting and filtering.

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [January 10, 2022, 9:56am UTC](https://community.prismic.io/t/cant-use-graphquery-sortby/8571/3 "2022-01-10T09:56:34Z")

</div>

Hey @sean1,

Thanks for posting this question, and welcome to the Prismic community 🙂

Unlike GraphQL, GraphQuery does not accept arguments. If I understand correctly, your API query would fail (because the graphQuery syntax is invalid) and throw an HTTP error, probably `400: Bad Request`. That could cause a CORS issue.

Having said that, I'm surprised that this GraphQuery option works for you at all. It looks like GraphQL syntax, rather than GraphQuery syntax.

In order to sort and filter with GraphQuery, you can use the regular Rest API sort and filter options, described [here under Query Options](https://prismic.io/docs/technologies/rest-api-technical-reference).

Sam
