Skip to main content

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.

FieldTypeRequiredDescription
rtIdOctoObjectIdYesThe runtime identifier of the entity
ckTypeIdStringYesThe 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

OperationInput Type PatternExample
Create[TypeName]InputIndustryEnergyEnergyMeterInput
Update[TypeName]InputUpdateIndustryEnergyEnergyMeterInputUpdate

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 rtId field 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.

FieldTypeDescription
attributePathStringThe path of the attribute to filter (e.g., contact.firstName)
operatorFilterOperatorThe comparison operator
comparisonValueSimpleScalarThe value to compare against

Sort

Used to define the sort order of query results. See Retrieve for usage examples.

FieldTypeDescription
attributePathStringThe path of the attribute to sort by (e.g., contact.firstName)
sortOrderSortOrderThe sort direction

SearchFilter

Used for text search across multiple attributes. See SearchFilter for detailed documentation.

FieldTypeRequiredDescription
searchTermStringYesThe text to search for
typeSearchFilterTypeYesATTRIBUTE_FILTER or TEXT_SEARCH
attributePaths[String]For ATTRIBUTE_FILTERList of attribute paths to search in
languageStringFor TEXT_SEARCHLanguage code for full-text search

Enum Types

FilterOperator

ValueDescription
EQUALSExact match between field value and comparison value
NOT_EQUALSField value does not equal comparison value
LESS_THANNumeric field value is less than comparison value
LESS_EQUAL_THANNumeric field value is less than or equal to comparison value
GREATER_THANNumeric field value is greater than comparison value
GREATER_EQUAL_THANNumeric field value is greater than or equal to comparison value
INField value is one of the values in the comparison array
NOT_INField value is not one of the values in the comparison array
LIKEWildcard match using * (e.g., *demo*)
MATCH_REG_EXRegular expression match (e.g., ^demo$)
ANY_EQFor array fields: any element equals the comparison value

SortOrder

ValueDescription
ASCENDINGSort A-Z, 0-9
DESCENDINGSort Z-A, 9-0
DEFAULTDatabase default order

GraphDirection

Used for association queries. See Retrieve for usage examples.

ValueDescription
ANYBoth incoming and outgoing associations
INBOUNDIncoming associations (target to source)
OUTBOUNDOutgoing associations (source to target)

SearchFilterType

ValueDescription
ATTRIBUTE_FILTERWildcard search in specified attribute paths
TEXT_SEARCHFull-text search using database text index