Skip to main content

CK Language 2

Models with ckLanguage: 2 add interfaces, method definitions and access modifiers to the construction kit. The constructionKit API exposes them. The new enumeration-like values are strings with PascalCase names (Public/Internal, Any/Model, ReadWrite/ReadOnly/MethodOnly/Hidden, Instance/Static); value types (valueType, attributeValueType) use the existing GraphQL enum (STRING, RECORD, ...). Elements of CK language 1 models report the v1 defaults (Public, Any, ReadWrite, ckLanguage: 1).

Overview Query​

The example uses the Acme.Assets model from the CK language 2 overview. The System models are still CK language 1, so they report no interfaces or methods yet.

query {
constructionKit {
types(rtCkId: "Acme.Assets/Device") {
items {
visibility
derivable
interfaces { rtCkInterfaceId }
methods {
methodId
kind
parameters { name valueType isOptional sensitive }
authorization { roles allowSelf }
}
attributes(first: 50) { items { attributeName access } }
}
}
interfaces(ckModelIds: ["Acme.Assets"]) {
items {
rtCkInterfaceId
extends { semanticVersionedFullName }
attributes { attributeName isOptional }
implementingTypes { semanticVersionedFullName }
}
}
models(first: 50) {
items {
id { name }
ckLanguage
dependencyRanges { range floor }
}
}
}
}

Interfaces​

interfaces(ckModelIds, rtCkId, rtCkIds) returns a connection of CkInterface:

FieldDescription
ckInterfaceId, rtCkInterfaceIdVersioned and version-less id (Acme.Assets/Named-1)
descriptionDescription
visibilityPublic or Internal
deprecatedtrue when the contract is deprecated
extends, allExtendsDirectly extended interfaces / all transitively extended interfaces
attributesAttribute members incl. those of extended interfaces: ckAttributeId, attributeName, attributeValueType, isOptional
associationsAssociation members: ckAssociationRoleId, targetCkTypeId, targetCkInterfaceId, multiplicity, isOptional, declaringCkInterfaceId
methodsMethod definitions (see below)
implementingTypesTypes implementing the interface (directly or inherited)

Types, Records, Enums, Attributes, Association Roles​

TypeFields
CkTypevisibility, derivable, declaredInterfaces (declared in implements), interfaces (declared, inherited and extended), methods (own and inherited)
CkTypeAttributeaccess
CkRecordvisibility, derivable
CkEnum, CkAttribute, CkAssociationRolevisibility

Methods​

CkMethod describes a method definition (method invocation is not available yet):

FieldDescription
methodIde.g. ChangePassword-1
qualifiedMethodIde.g. System.Identity/User.ChangePassword-1 (type methods)
declaringCkTypeId / declaringCkInterfaceIdWhere the method is declared
kindInstance or Static
description, visibility
parametersname, valueType, valueCkRecordId, valueCkEnumId, isOptional, sensitive, description
resultvalueType, valueCkRecordId, valueCkEnumId; null when the method has no result
errorsDeclared error codes (CkMethodErrorDefinition: code, description)
authorizationroles, allowSelf, scopes
executiontimeoutSeconds (effective value), idempotent

Models​

FieldDescription
ckLanguage1 or 2 (1 when not declared)
minEngineVersionMinimum engine version: set for CK language 2 and range-retaining models, and inherited by any model compiled against such a dependency
dependencyRangesrange and floor per declared dependency of a range-retaining model; null for exact-pinned models