# Internal server error when using \`where\` field in GraphQL API

**URL:** <https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828>\
**Category:** Developing with Prismic\
**Tags:** graphql\
**Created:** [June 15, 2020, 5:14pm UTC](https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828 "2020-06-15T17:14:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![asa](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@asa](https://community.prismic.io/u/asa)\
**Post date:** [June 15, 2020, 5:14pm UTC](https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828/1 "2020-06-15T17:14:41Z")

</div>

I'm getting a server error when trying to query using the `where` filter.

 ![Screen Shot 2020-06-15 at 10.12.15 AM](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/1X/03f5c6f4df8ac41b372b80bf1d45559f2521aa12.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:** [June 16, 2020, 3:40pm UTC](https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828/3 "2020-06-16T15:40:01Z")

</div>

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. You’ll need to re-populate the new field with content after changing its API ID.

To learn more about this, read this article: [What happens if I remove or rename the API ID of a field on a Custom Type](https://user-guides.prismic.io/en/articles/2998133-what-happens-if-i-remove-or-rename-the-api-id-of-a-field-on-a-custom-type).

---

<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 17, 2020, 1:38am UTC](https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828/4 "2020-06-17T01:38:16Z")

</div>

@Pau Thanks for the explanation, I think this was the cause of [my ticket as well](https://community.prismic.io/t/graphql-wherefilter-throws-500-filtering-boolean/849).

Is there a plan for the Prismic team to fix this? Naming a field with an underscore is a completely reasonable ask, especially since api fields appear to only allow lowercase characters. Using an underscore to make a field more readable shouldn’t break querying

---

<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:54pm UTC](https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828/6 "2020-06-17T15:54:23Z")

</div>

**[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!**

@alex I’m glad you found the answer!

You’re are totally right, it would be a reasonable thing to have as a possibility when creating queries.

I’ve submitted it as a bug to the issue tracker so that the dev team can be aware of it.

---

<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 25, 2020, 1:29pm UTC](https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828/7 "2020-06-25T13:29:04Z")

</div>

For anyone who needs this fix activated on their account please send a private message to the Activations Team with your repository name as described in this post. 😁

> [@Feature Activations (GraphQL, Integration Fields etc.)](https://community.prismic.io/t/feature-activations-graphql-integration-fields-etc/847):
>
> This thread details how to request activation of the following Prismic features: Integration Fields Environments (Platinum Plan) You can also ask for these 'action' requests: Main locale changes Deleting user accounts Media removal requests Features that are activated by default (Need activated on legacy repos): GraphQL (Visit [https://your-repo-name.prismic.io/graphql](https://your-repo-name.prismic.io/graphql) to see your GraphQL browser) New toolbar/edit button (If the preview script in your repo has new=true, you are up to date…

---

<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:** [September 15, 2020, 4:46pm UTC](https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828/9 "2020-09-15T16:46:13Z")

</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:34pm UTC](https://community.prismic.io/t/internal-server-error-when-using-where-field-in-graphql-api/828/10 "2021-12-09T17:34:36Z")

</div>


