Skip to main content

Records

Records are composite value types that group related attributes together. Unlike types, records are embedded directly within entities rather than being independent entities with their own runtime IDs.

List Records

Retrieve all records:

query getCkRecords($after: String, $first: Int, $ckModelIds: [String]) {
constructionKit {
records(after: $after, first: $first, ckModelIds: $ckModelIds) {
totalCount
items {
ckRecordId {
fullName
semanticVersionedFullName
}
}
}
}
}

Response

{
"data": {
"constructionKit": {
"records": {
"totalCount": 5,
"items": [
{
"ckRecordId": {
"fullName": "Basic-1.0.0/Contact-1",
"semanticVersionedFullName": "Basic/Contact"
}
},
{
"ckRecordId": {
"fullName": "Basic-1.0.0/Address-1",
"semanticVersionedFullName": "Basic/Address"
}
}
]
}
}
}
}

Filter by Model

Retrieve records from specific models:

query {
constructionKit {
records(ckModelIds: ["Basic-1"]) {
totalCount
items {
ckRecordId {
fullName
}
}
}
}
}

Record Details

Retrieve detailed information about a specific record including its attributes and inheritance:

query getCkRecordDetails($ckId: String) {
constructionKit {
records(ckId: $ckId) {
totalCount
items {
ckRecordId {
fullName
semanticVersionedFullName
}
description
isAbstract
isFinal
baseRecordTypes {
ckRecordId {
fullName
semanticVersionedFullName
}
isAbstract
isFinal
}
derivedRecordTypes {
pageInfo {
endCursor
hasNextPage
}
items {
ckRecordId {
fullName
}
isAbstract
isFinal
}
}
attributes {
pageInfo {
endCursor
hasNextPage
}
items {
attributeName
attributeValueType
ckAttributeId {
fullName
semanticVersionedFullName
}
isOptional
}
}
}
}
}
}

Variables:

{
"ckId": "Basic-1.0.0/Contact-1"
}

Response

{
"data": {
"constructionKit": {
"records": {
"totalCount": 1,
"items": [
{
"ckRecordId": {
"fullName": "Basic-1.0.0/Contact-1",
"semanticVersionedFullName": "Basic/Contact"
},
"description": "Contact information including name and address",
"isAbstract": false,
"isFinal": false,
"baseRecordTypes": [],
"derivedRecordTypes": {
"pageInfo": {
"endCursor": null,
"hasNextPage": false
},
"items": []
},
"attributes": {
"pageInfo": {
"endCursor": "YXJyYXljb25uZWN0aW9uOjU=",
"hasNextPage": false
},
"items": [
{
"attributeName": "firstName",
"attributeValueType": "STRING",
"ckAttributeId": {
"fullName": "Basic-1.0.0/FirstName-1",
"semanticVersionedFullName": "Basic/FirstName"
},
"isOptional": true
},
{
"attributeName": "lastName",
"attributeValueType": "STRING",
"ckAttributeId": {
"fullName": "Basic-1.0.0/LastName-1",
"semanticVersionedFullName": "Basic/LastName"
},
"isOptional": true
},
{
"attributeName": "companyName",
"attributeValueType": "STRING",
"ckAttributeId": {
"fullName": "Basic-1.0.0/CompanyName-1",
"semanticVersionedFullName": "Basic/CompanyName"
},
"isOptional": true
},
{
"attributeName": "address",
"attributeValueType": "RECORD",
"ckAttributeId": {
"fullName": "Basic-1.0.0/Address-1",
"semanticVersionedFullName": "Basic/Address"
},
"isOptional": true
}
]
}
}
]
}
}
}
}

Record Inheritance

Records support inheritance similar to types. A derived record inherits all attributes from its base record:

query {
constructionKit {
records(ckId: "Basic-1.0.0/ExtendedContact-1") {
items {
ckRecordId {
fullName
}
baseRecordTypes {
ckRecordId {
fullName
}
}
attributes {
items {
attributeName
attributeValueType
}
}
}
}
}
}

Response

{
"data": {
"constructionKit": {
"records": {
"items": [
{
"ckRecordId": {
"fullName": "Basic-1.0.0/ExtendedContact-1"
},
"baseRecordTypes": [
{
"ckRecordId": {
"fullName": "Basic-1.0.0/Contact-1"
}
}
],
"attributes": {
"items": [
{ "attributeName": "firstName", "attributeValueType": "STRING" },
{ "attributeName": "lastName", "attributeValueType": "STRING" },
{ "attributeName": "companyName", "attributeValueType": "STRING" },
{ "attributeName": "address", "attributeValueType": "RECORD" },
{ "attributeName": "email", "attributeValueType": "STRING" },
{ "attributeName": "phone", "attributeValueType": "STRING" }
]
}
}
]
}
}
}
}

Nested Records

Records can contain other records as attributes. In the example above, Contact contains an Address record:

query {
constructionKit {
records(ckId: "Basic-1.0.0/Address-1") {
items {
ckRecordId {
fullName
}
attributes {
items {
attributeName
attributeValueType
}
}
}
}
}
}

Response

{
"data": {
"constructionKit": {
"records": {
"items": [
{
"ckRecordId": {
"fullName": "Basic-1.0.0/Address-1"
},
"attributes": {
"items": [
{ "attributeName": "street", "attributeValueType": "STRING" },
{ "attributeName": "cityTown", "attributeValueType": "STRING" },
{ "attributeName": "zipcode", "attributeValueType": "INT32" },
{ "attributeName": "country", "attributeValueType": "STRING" }
]
}
}
]
}
}
}
}

Record Fields

CkRecord

FieldTypeDescription
ckRecordIdCkRecordIdThe record identifier
descriptionStringDescription of the record
isAbstractBooleanWhether the record is abstract
isFinalBooleanWhether the record can be extended
baseRecordTypes[CkRecord]Parent records (inheritance)
derivedRecordTypesCkRecordConnectionRecords that extend this record
attributesCkRecordAttributeConnectionAttributes defined on this record

CkRecordAttribute

FieldTypeDescription
attributeNameStringThe name of the attribute
attributeValueTypeStringThe data type
ckAttributeIdCkAttributeIdReference to the attribute definition
isOptionalBooleanWhether the attribute is optional