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

# Advanced Querying

It is possible to construct advanced GraphQL queries using the following features.

## Comparison Operators

A comparison operator field allows you to define a condition that is more complex than exact equality, such as a range query.

| Operator | Description                                                                     |
| -------- | ------------------------------------------------------------------------------- |
| gt       | Finds results where the field is greater than the specified value.              |
| gte      | Finds results where the field is greater than or equal to the specified value.  |
| lt       | Finds results where the field is less than the specified value.                 |
| lte      | Finds results where the field is less than or equal to the specified value.     |
| ne       | Finds results where the field is not equal to the specified value.              |
| in       | Finds results where the field is equal to any value in the specified array.     |
| nin      | Finds results where the field is not equal to any value in the specified array. |
| exists   | Finds documents where the field is not `null`.                                  |

## Logical Operators

A logical operator field allows you to define logical combinations of independent `QueryInput` objects.

| Operator | Description                                                            |
| -------- | ---------------------------------------------------------------------- |
| AND      | Finds documents that match *all* of the provided `QueryInput` objects. |
| OR       | Finds documents that match *any* of the provided `QueryInput` objects. |

```json theme={null}
blocks(
    query: {
      AND: [
        { protocolState: { consensusState: { epoch: 2 } } }
        { stateHash: "3NK6UJfL6WWvqsdLGdmpYpmmRrdR8oCZsq3AuWdRnH8WcmaFGiRn" }
      ]
    }
  )
```

```json theme={null}
snarks(
    query: {
      OR: [
        { prover: "B62qnwquaQY3xc8eReKbhQq3oE8WDuzufr4jNWnKVCXBiqzSTmTstS7" }
        { fee_gt: 40000 }
      ]
    }
  )
```

## Sorting

You can sort in ascending and descending order by any root-level field that does not have a type of `object` or `array.`

```json theme={null}
snarks(
    limit: 10
    sortBy: FEE_DESC
    }
  )
```
