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:
| Field | Description |
|---|---|
ckInterfaceId, rtCkInterfaceId | Versioned and version-less id (Acme.Assets/Named-1) |
description | Description |
visibility | Public or Internal |
deprecated | true when the contract is deprecated |
extends, allExtends | Directly extended interfaces / all transitively extended interfaces |
attributes | Attribute members incl. those of extended interfaces: ckAttributeId, attributeName, attributeValueType, isOptional |
associations | Association members: ckAssociationRoleId, targetCkTypeId, targetCkInterfaceId, multiplicity, isOptional, declaringCkInterfaceId |
methods | Method definitions (see below) |
implementingTypes | Types implementing the interface (directly or inherited) |
Types, Records, Enums, Attributes, Association Roles
| Type | Fields |
|---|---|
CkType | visibility, derivable, declaredInterfaces (declared in implements), interfaces (declared, inherited and extended), methods (own and inherited) |
CkTypeAttribute | access |
CkRecord | visibility, derivable |
CkEnum, CkAttribute, CkAssociationRole | visibility |
Methods
CkMethod describes a method definition (method invocation is not available yet):
| Field | Description |
|---|---|
methodId | e.g. ChangePassword-1 |
qualifiedMethodId | e.g. System.Identity/User.ChangePassword-1 (type methods) |
declaringCkTypeId / declaringCkInterfaceId | Where the method is declared |
kind | Instance or Static |
description, visibility | |
parameters | name, valueType, valueCkRecordId, valueCkEnumId, isOptional, sensitive, description |
result | valueType, valueCkRecordId, valueCkEnumId; null when the method has no result |
errors | Declared error codes (CkMethodErrorDefinition: code, description) |
authorization | roles, allowSelf, scopes |
execution | timeoutSeconds (effective value), idempotent |
Models
| Field | Description |
|---|---|
ckLanguage | 1 or 2 (1 when not declared) |
minEngineVersion | Minimum engine version: set for CK language 2 and range-retaining models, and inherited by any model compiled against such a dependency |
dependencyRanges | range and floor per declared dependency of a range-retaining model; null for exact-pinned models |