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.

query {
    car{
        Id
        make
        color
        engine{
            id
            model
        }
    }
}

Response:

{
    "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

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

Response:

{
    "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

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

Response:

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

Last updated