# Sort Methods in Graphiql

**URL:** https://community.prismic.io/t/sort-methods-in-graphiql/4466
**Category:** Developing with Prismic
**Tags:** gatsby
**Created:** [March 10, 2021, 7:44pm UTC](https://community.prismic.io/t/sort-methods-in-graphiql/4466 "2021-03-10T19:44:20Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![maddy](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@maddy](https://community.prismic.io/u/maddy)
#### Post date: [March 10, 2021, 7:44pm UTC](https://community.prismic.io/t/sort-methods-in-graphiql/4466/1 "2021-03-10T19:44:20Z")

</div>

Hi I am working on refactoring a project to use the new gatsby-source-prismic plugin and I am having an issue whenever I try to use sort or limit. It states it 'can't read property map of undefined'. However when I removed the filtering the query works and returns data with no problem.

 ![Screen Shot 2021-03-10 at 2.41.56 PM](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/d/d8fad787eefcae13270fe687109c17ce34040905.png)

Here it is without it:

 ![Screen Shot 2021-03-10 at 2.43.57 PM](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/0/0b0c806d6b3c92588d43d0da05625c082ed10e54.png)

---

<div class="post-metadata">

### Author: ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)
#### Post date: [March 11, 2021, 5:58pm UTC](https://community.prismic.io/t/sort-methods-in-graphiql/4466/3 "2021-03-11T17:58:40Z")

</div>

Hey Maddy, I tested the argument and was able to reproduce this error. I've added it to the dev team's backlog. As soon as I have some news, I'll let you know.

Thanks

---

<div class="post-metadata">

### Author: ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)
#### Post date: [March 24, 2021, 3:43pm UTC](https://community.prismic.io/t/sort-methods-in-graphiql/4466/6 "2021-03-24T15:43:34Z")

</div>

Hi @maddy,

I believe the issue here is that you've specified `order` here but not the filed to order it by, to quote the docs:

> You use two parameters for this argument: field to specify the Prismic field ID and order to specify if you want it sorted ascending (ASC) or descending (DESC). You can use any metadata or a Prismic field.

You can read the full docs here:

> **[Gatsby + Prismic v6: Faster and Simpler](https://prismic.io/blog/gatsby-prismic-v6)**
>
> Gatsby and Prismic v6 will be the last major version to be released by Prismic. Documentation can now be found in the plugins’ GitHub repository.

Thanks.

---

<div class="post-metadata">

### Author: ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)
#### Post date: [April 1, 2021, 3:48pm UTC](https://community.prismic.io/t/sort-methods-in-graphiql/4466/7 "2021-04-01T15:48:53Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

### Author: ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)
#### Post date: [December 9, 2021, 4:25pm UTC](https://community.prismic.io/t/sort-methods-in-graphiql/4466/8 "2021-12-09T16:25:44Z")

</div>


