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
| Field | Type | Description |
|---|---|---|
ckRecordId | CkRecordId | The record identifier |
description | String | Description of the record |
isAbstract | Boolean | Whether the record is abstract |
isFinal | Boolean | Whether the record can be extended |
baseRecordTypes | [CkRecord] | Parent records (inheritance) |
derivedRecordTypes | CkRecordConnection | Records that extend this record |
attributes | CkRecordAttributeConnection | Attributes defined on this record |
CkRecordAttribute
| Field | Type | Description |
|---|---|---|
attributeName | String | The name of the attribute |
attributeValueType | String | The data type |
ckAttributeId | CkAttributeId | Reference to the attribute definition |
isOptional | Boolean | Whether the attribute is optional |