Built-in attributes

There are some attributes which are added to the assets stored on the ledger which are added by the Blockchain. As these attributes are not part of the asset data, a special syntax is required to fetch them in queries. These attributes can be fetched by specifying an object called "ledgerMetadata" as one of the fields. For e.g. to get the owners of an asset:

{
    Car {
        Id
        make
        ledgerMetadata{
            owners
        }
    }
}

Response:

{
    "data": {
        "Car_count": 1,
        "Car": [
            {
                "Id": "car1",
                "make": "ford",
                "ledgerMetadata": {
                    "owners": [
                        {
                            "orgId": "641821e82c44573cb52c7d97"
                        }
                    ]
                }
            }
        ]
    }
}

The following built-in fields are avaiable to be queried as part of ledgerMetadata

  • owners

  • createdAt

  • updatedAt

  • createdBy

  • updatedBy

Last updated