> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# AND/OR filters

> Combine GraphQL query filters with AND/OR operators in OpenReader — basic logic combinators for refining entity queries served by Squid SDK.

## Overview

Our GraphQL implementation offers a vast selection of tools to filter and section results. One of these is the `where` clause, very common in most database query languages and [explained here](/en/sdk/squid-sdk/reference/openreader-server/api/queries#filter-query-results-search-queries) in detail.

In our GraphQL server implementation, we included logical operators to be used in the `where` clause, allowing to group multiple parameters in the same `where` argument using the `AND` and `OR` operators to filter results based on more than one criteria.

Note that the [newer](/en/sdk/squid-sdk/reference/openreader-server/overview#supported-queries) and [more advanced](/en/sdk/squid-sdk/reference/openreader-server/api/paginate-query-results) `{entityName}sConnection` queries support exactly the same format of the `where` argument as the older `{entityName}s` queries used in the examples provided here.

### Example of an `OR` clause:

Fetch a list of `accounts` that either have a balance bigger than a certain amount, or have a specific id.

```graphql theme={"system"}
query {
  accounts(
    orderBy: balance_DESC, 
    where: {
      OR: [
        {balance_gte: "240000000000000000"}
        {id_eq: "CksmaBx9rKUG9a7eXwc5c965cJ3QiiC8ELFsLtJMYZYuRWs"}
      ]
    }
  ) {
    balance
    id
  }
}

```

### Example of `AND` clause:

Fetch a list of `accounts` that have a balance between two specific amounts:

```graphql theme={"system"}
query {
  accounts(
    orderBy: balance_DESC, 
    where: {
      AND: [
        {balance_lte: "240000000000000000"}
        {balance_gte: "100000000000000"}
      ]
    }
  ) {
    balance
    id
  }
}

```
