Simple queries

query {
    document {
            assetID,
            color
            appraisedValue
        }
}

Response:

{
    "data": {
        "document_count": 2,
        "document": [
            {
                "appraisedValue": 100,
                "assetID": "asset1",
                "color": "blue"
            },
            {
                "appraisedValue": 100,
                "assetID": "asset2",
                "color": "red"
            }
        ]
    }
}

Simple condition

Specify a simple condition by including a key, value pair as an argument. For e.g. the below query gets all car assets which have blue color.

query {
    document (color: "blue") {
            assetID,
            color
            appraisedValue
        }
}

Response:

{
    "data": {
        "document_count": 1,
        "document": [
            {
                "appraisedValue": 100,
                "assetID": "asset1",
                "color": "blue"
            }
        ]
    }
}

Multiple conditions

Specify multiple conditions by including multiple comma separated key, value pairs as an argument. When you specify multiple conditions like this, the conditions are combined using the "and" operator. For e.g. get all assets where color is blue and size is 5.

query {
    document (color: "blue", size:5) {
            assetID,
            color
            appraisedValue
            size
        }
}

Response:

{
    "data": {
        "document_count": 1,
        "document": [
            {
                "appraisedValue": 100,
                "assetID": "asset1",
                "color": "blue",
                "size": 5
            }
        ]
    }
}

Last updated