# Complex queries

Use the "where" argument to construct complex queries that has multiple conditions and nesting levels. For e.g. to query all assets with size greater than 5

```graphql
query {
    document (size: {_gt: 5}) {
            assetID,
            color
            appraisedValue
            size
        }
}
```

Response:

```json
{
    "data": {
        "document_count": 2,
        "document": [
            {
                "appraisedValue": 200,
                "assetID": "asset3",
                "color": "green",
                "size": 10
            },
            {
                "appraisedValue": 200,
                "assetID": "asset4",
                "color": "yellow",
                "size": 10
            }
        ]
    }
}
```

The query can include multiple conditions and include conditions on nested object fields too. For a complete list of supported operators, refer to [Operator](/developers/api-reference/asset-tokenization/graphql/operators.md)

**Complex query – multiple conditions**

```graphql
query {
    document (_or: [
                {size: {_gt: 10}},
                {color: {_eq: "blue"}}
            ]) {
            assetID,
            color
            appraisedValue
            size
        }
}
```

Response:

```json
{
    "data": {
        "document_count": 3,
        "document": [
            {
                "appraisedValue": 100,
                "assetID": "asset1",
                "color": "blue",
                "size": 5
            },
            {
                "appraisedValue": 250,
                "assetID": "asset5",
                "color": "black",
                "size": 15
            },
            {
                "appraisedValue": 250,
                "assetID": "asset6",
                "color": "white",
                "size": 15
            }
        ]
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.spydra.app/developers/api-reference/custom-chaincode/graphql/complex-queries.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
