# How to use 'or' operator in the queries?

**URL:** <https://forum.thegraph.com/t/how-to-use-or-operator-in-the-queries/2897>\
**Category:** Questions & Feedback\
**Created:** [January 5, 2022, 1:06pm UTC](https://forum.thegraph.com/t/how-to-use-or-operator-in-the-queries/2897 "2022-01-05T13:06:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prabal](https://avatars.discourse-cdn.com/v4/letter/p/3da27b/32.png) [@Prabal](https://forum.thegraph.com/u/Prabal)\
**Post date:** [January 5, 2022, 1:06pm UTC](https://forum.thegraph.com/t/how-to-use-or-operator-in-the-queries/2897/1 "2022-01-05T13:06:54Z")

</div>

How to use ‘or’ operator in the queries?

---

<div class="post-metadata">

**Author:** ![Slimchance](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.thegraph.com/slimchance/32/409_2.png) [@Slimchance](https://forum.thegraph.com/u/Slimchance)\
**Post date:** [January 6, 2022, 10:38am UTC](https://forum.thegraph.com/t/how-to-use-or-operator-in-the-queries/2897/2 "2022-01-06T10:38:57Z")

</div>

Hi! This is not currently possible.

The Guild joined The Graph as a core developer team, and they are currently working on this and other features. If you are interested, they talked about this during the last community talk. [The Graph’s Community Talk #6 - YouTube](https://youtu.be/oxU9_kP5uy8?t=1306) (timestamped)

A workaround would be to use aliases. You will be able to retrieve all results in a single query, but you will not be able to sort across the “root queries”

```auto
{
   q1: books (where: {category_contains: "Math"}) {
   ...
   }
   q2: books (where: {category_contains: "Sci-Fi"}) {
   ...
   } 
   q3: books (where: {category_contains: "Subgraphs"}) {
   ...
   }  
}

```
