# Nested object queries

These queries are used to get assets based on nested object fields and also specify the fields that need to be retrieved in nested objects.

> ```graphql
> query {
>     car{
>         Id
>         make
>         color
>         engine{
>             id
>             model
>         }
>     }
> }
> ```

Response:

```json
{
    "data": {
        "car_count": 1,
        "car": [
            {
                "Id": "car1",
                "color": "red",
                "engine": {
                    "id": 9001,
                    "model": "petrol"
                },
                "make": "ford"
            }
        ]
    }
}
```

### Nested condition

Conditions can be specified at the nested object level

```graphql
query {
    car{
        Id
        make
        color
        engine (lotId: 123) {
            id
            lotId
            model
        }
    }
}
```

Response:

```json
{
    "data": {
        "car_count": 1,
        "car": [
            {
                "Id": "car1",
                "color": "red",
                "engine": {
                    "id": 9001,
                    "lotId": 123,
                    "model": "petrol"
                },
                "make": "ford"
            }
        ]
    }
}
```

### Multiple nested conditions

Multiple conditions can be specified at different levels. In case of multiple conditions, they are combined using the "and" operator&#x20;

```graphql
query {
    car (color: "red", make: "ford") {
        Id
        make
        color
        engine (lotId: 123) {
            id
            model
            lotId
        }
```

Response:

```json
{
    "data": {
        "car_count": 1,
        "car": [
            {
                "Id": "car1",
                "color": "red",
                "engine": {
                    "id": 9001,
                    "lotId": 123,
                    "model": "petrol"
                },
                "make": "ford"
            }
        ]
    }
}
```


---

# 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/asset-tokenization/graphql/nested-object-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.
