Runtime Model
GraphQL allows to query and mutate data. Mutations are operations like create, update and delete. This chapter describes how data can be created, retrieved, updated and deleted. It provides a reference for the GraphQL scalar types, input types, and enums used in the OctoMesh GraphQL API.
In OctoMesh, the GraphQL runtime API provides access to the Runtime Model entities. You can query these entities using the runtime field in your GraphQL queries.
Scalar Types
OctoObjectId
A 24-character hexadecimal string that uniquely identifies a runtime entity. Based on MongoDB's ObjectId format.
Format: [0-9a-f]{24}
Example: 65dc6d24cc529cdc46c84fcc
SimpleScalar
A flexible scalar that can represent various primitive values (strings, numbers, booleans). Commonly used for configuration values, comparison values in filters, and dynamic data.
LargeBinary
Used for binary data, typically for file uploads. Accepts Base64-encoded strings.
Composite Types
RtEntityId
A composite input type used primarily for delete operations. Combines the runtime identifier with the type information.
| Field | Type | Required | Description |
|---|---|---|---|
rtId | OctoObjectId | Yes | The runtime identifier of the entity |
ckTypeId | String | Yes | The construction kit type identifier (e.g., Industry.Energy/EnergyMeter) |
RtCkTypeId
References a type in the construction kit from runtime operations.
Format: [Model]/[TypeName]
Examples: Industry.Energy/EnergyMeter, System.Communication/MeshAdapter
Input Types
Naming Conventions
| Operation | Input Type Pattern | Example |
|---|---|---|
| Create | [TypeName]Input | IndustryEnergyEnergyMeterInput |
| Update | [TypeName]InputUpdate | IndustryEnergyEnergyMeterInputUpdate |
Create vs Update Input Types
- Create Input Types: Contain all fields that can be set when creating a new entity. Required fields must be provided.
- Update Input Types: Always require the
rtIdfield to identify the entity. All other fields are optional - only provided fields will be updated.
Query Parameter Types
FieldFilter
Used to filter query results based on attribute conditions. See Retrieve for usage examples.
| Field | Type | Description |
|---|---|---|
attributePath | String | The path of the attribute to filter (e.g., contact.firstName) |
operator | FilterOperator | The comparison operator |
comparisonValue | SimpleScalar | The value to compare against |
Sort
Used to define the sort order of query results. See Retrieve for usage examples.
| Field | Type | Description |
|---|---|---|
attributePath | String | The path of the attribute to sort by (e.g., contact.firstName) |
sortOrder | SortOrder | The sort direction |
SearchFilter
Used for text search across multiple attributes. See SearchFilter for detailed documentation.
| Field | Type | Required | Description |
|---|---|---|---|
searchTerm | String | Yes | The text to search for |
type | SearchFilterType | Yes | ATTRIBUTE_FILTER or TEXT_SEARCH |
attributePaths | [String] | For ATTRIBUTE_FILTER | List of attribute paths to search in |
language | String | For TEXT_SEARCH | Language code for full-text search |
Enum Types
FilterOperator
| Value | Description |
|---|---|
EQUALS | Exact match between field value and comparison value |
NOT_EQUALS | Field value does not equal comparison value |
LESS_THAN | Numeric field value is less than comparison value |
LESS_EQUAL_THAN | Numeric field value is less than or equal to comparison value |
GREATER_THAN | Numeric field value is greater than comparison value |
GREATER_EQUAL_THAN | Numeric field value is greater than or equal to comparison value |
IN | Field value is one of the values in the comparison array |
NOT_IN | Field value is not one of the values in the comparison array |
LIKE | Wildcard match using * (e.g., *demo*) |
MATCH_REG_EX | Regular expression match (e.g., ^demo$) |
ANY_EQ | For array fields: any element equals the comparison value |
SortOrder
| Value | Description |
|---|---|
ASCENDING | Sort A-Z, 0-9 |
DESCENDING | Sort Z-A, 9-0 |
DEFAULT | Database default order |
GraphDirection
Used for association queries. See Retrieve for usage examples.
| Value | Description |
|---|---|
ANY | Both incoming and outgoing associations |
INBOUND | Incoming associations (target to source) |
OUTBOUND | Outgoing associations (source to target) |
SearchFilterType
| Value | Description |
|---|---|
ATTRIBUTE_FILTER | Wildcard search in specified attribute paths |
TEXT_SEARCH | Full-text search using database text index |