# GraphQL: whereFilter throws 500 filtering Boolean

**URL:** <https://community.prismic.io/t/graphql-wherefilter-throws-500-filtering-boolean/849>\
**Category:** Developing with Prismic\
**Tags:** graphql\
**Created:** [June 16, 2020, 5:10pm UTC](https://community.prismic.io/t/graphql-wherefilter-throws-500-filtering-boolean/849 "2020-06-16T17:10:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@alex](https://community.prismic.io/u/alex)\
**Post date:** [June 16, 2020, 5:10pm UTC](https://community.prismic.io/t/graphql-wherefilter-throws-500-filtering-boolean/849/1 "2020-06-16T17:10:39Z")

</div>

I created a new content type (lets call it Content) with a boolean field (lets call it "flag"), and then I try to to run a GraphQL query structured  
allContent(where: { "flag": true }) {...} is throwing a 500 error. Is filtering on a boolean field broken in the GraphQL API?

---

<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:** [June 16, 2020, 5:28pm UTC](https://community.prismic.io/t/graphql-wherefilter-throws-500-filtering-boolean/849/2 "2020-06-16T17:28:06Z")

</div>

Hello @alex, welcome to the community forum!

If you’re trying to use that exact query, it isn’t going to work because of the quotation marks. Try this one instead:

` allContent(where: { flag: true }) {…}`

You can browse the available fields than can be used with the `where` argument and in all the schema using `shift + space` in the keyboard.

---

<div class="post-metadata">

**Author:** ![alex](https://avatars.discourse-cdn.com/v4/letter/a/db5fbb/32.png) [@alex](https://community.prismic.io/u/alex)\
**Post date:** [June 16, 2020, 5:36pm UTC](https://community.prismic.io/t/graphql-wherefilter-throws-500-filtering-boolean/849/3 "2020-06-16T17:36:53Z")

</div>

No sorry , I meant allContent(where: { flag: true }) {…} without quotation marks. I am using this query in the prismic graphql playground so I am using that to choose the value from the schema and it 500.

Its a field I added to multiple content types that already have some content made thats causing a 500 error. When I create a new boolean field in a new content type it works fine. Seems like I'm hitting some strange edge case

---

<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:** [June 17, 2020, 3:32pm UTC](https://community.prismic.io/t/graphql-wherefilter-throws-500-filtering-boolean/849/5 "2020-06-17T15:32:19Z")

</div>

This issue is related to this resolved thread:

> [@Internal server error when using \`where\` field in GraphQL API](https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828/3):
>
> Hello @asa! [UPDATE] We’ve just released a fixed for this issue. If you want to have access to the fix send us a private message with the url of your repository! This is happening because, if the API ID for field has an underscore, this can cause the query to break. You can solve this by changing the API ID of the field to be able to perform the query: visibleonsite . Just remember that If you do this, it will cause the content of the original field to disappear from all existing documents. …

---

<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:** [June 17, 2020, 3:55pm UTC](https://community.prismic.io/t/graphql-wherefilter-throws-500-filtering-boolean/849/6 "2020-06-17T15:55:53Z")

</div>



---

<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, 5:35pm UTC](https://community.prismic.io/t/graphql-wherefilter-throws-500-filtering-boolean/849/7 "2021-12-09T17:35:48Z")

</div>


