Skip to main content

Transient Queries

Transient queries allow you to dynamically query runtime entities with configurable column paths. Unlike regular queries where the returned fields are defined in the GraphQL query itself, transient queries return data in a table-like structure with rows and cells.

Use cases

Transient queries are useful when:

  • Building dynamic table views where columns are user-configurable
  • The set of attributes to retrieve is not known at compile time
  • You need a tabular data format with metadata about columns

Basic usage

query getTransientRuntimeQuery(
$ckId: String!
$columnPaths: [String!]!
$first: Int
$after: String
) {
runtime {
transientRuntimeQuery(
ckId: $ckId
columnPaths: $columnPaths
first: $first
after: $after
) {
items {
columns {
attributePath
attributeValueType
}
rows(first: $first, after: $after) {
totalCount
items {
rtId
cells {
items {
attributePath
value
}
}
}
}
}
}
}
}

Variables:

{
"ckId": "EnergyCommunity/Customer",
"columnPaths":["rtId", "contact.firstName"],
"first": 10
}

Response structure

The response contains:

  • columns: Metadata about each requested column (attribute path and value type)
  • rows: The actual data rows with cells containing values
{
"data": {
"runtime": {
"transientRuntimeQuery": {
"items": [
{
"columns": [
{
"attributePath": "contact.firstName",
"attributeValueType": "STRING"
},
{
"attributePath": "rtId",
"attributeValueType": "STRING"
}
],
"rows": {
"totalCount": 9,
"items": [
{
"rtId": "693c4cd3464d7d9e1396cf0d",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "John"
},
{
"attributePath": "rtId",
"value": "693c4cd3464d7d9e1396cf0d"
}
]
}
},
{
"rtId": "693c4d3e464d7d9e1396cf0e",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "John"
},
{
"attributePath": "rtId",
"value": "693c4d3e464d7d9e1396cf0e"
}
]
}
},
{
"rtId": "693c4d97464d7d9e1396cf0f",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "John"
},
{
"attributePath": "rtId",
"value": "693c4d97464d7d9e1396cf0f"
}
]
}
},
{
"rtId": "693c4d97464d7d9e1396cf10",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "Jane"
},
{
"attributePath": "rtId",
"value": "693c4d97464d7d9e1396cf10"
}
]
}
},
{
"rtId": "693c51af464d7d9e1396cf11",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "John"
},
{
"attributePath": "rtId",
"value": "693c51af464d7d9e1396cf11"
}
]
}
},
{
"rtId": "693c51af464d7d9e1396cf12",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "Jane"
},
{
"attributePath": "rtId",
"value": "693c51af464d7d9e1396cf12"
}
]
}
},
{
"rtId": "693c51af464d7d9e1396cf13",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "Max"
},
{
"attributePath": "rtId",
"value": "693c51af464d7d9e1396cf13"
}
]
}
},
{
"rtId": "693c51af464d7d9e1396cf14",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "Erika"
},
{
"attributePath": "rtId",
"value": "693c51af464d7d9e1396cf14"
}
]
}
},
{
"rtId": "693c51af464d7d9e1396cf15",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "Paul"
},
{
"attributePath": "rtId",
"value": "693c51af464d7d9e1396cf15"
}
]
}
}
]
}
}
]
}
}
}
}

Column paths

Column paths can reference:

  • Direct attributes: "name", "voltage", "state"
  • Nested attributes (records): "contact.firstName", "address.street"
  • Association attributes: "customer.name" (via association)

Combining with filters and sorting

Transient queries support all standard query parameters:

query getTransientRuntimeQuery(
$ckId: String!
$columnPaths: [String!]!
$first: Int
$after: String
) {
runtime {
transientRuntimeQuery(
ckId: $ckId
columnPaths: $columnPaths
first: $first
after: $after
searchFilter: {
searchTerm: "John"
type: ATTRIBUTE_FILTER
attributePaths: ["contact.firstName"]
}
fieldFilter: [
{ attributePath: "state", operator: EQUALS, comparisonValue: "ACTIVE" }
]
sortOrder: [
{ attributePath: "contact.firstName", sortOrder: ASCENDING }
]
) {
items {
columns {
attributePath
attributeValueType
}
rows(first: $first, after: $after) {
totalCount
items {
rtId
cells {
items {
attributePath
value
}
}
}
}
}
}
}
}

This query filters for entities where the contact's first name contains "John" and the state is "ACTIVE", sorted by first name.

{
"data": {
"runtime": {
"transientRuntimeQuery": {
"items": [
{
"columns": [
{
"attributePath": "contact.firstName",
"attributeValueType": "STRING"
},
{
"attributePath": "rtId",
"attributeValueType": "STRING"
}
],
"rows": {
"totalCount": 4,
"items": [
{
"rtId": "693c4cd3464d7d9e1396cf0d",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "John"
},
{
"attributePath": "rtId",
"value": "693c4cd3464d7d9e1396cf0d"
}
]
}
},
{
"rtId": "693c4d3e464d7d9e1396cf0e",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "John"
},
{
"attributePath": "rtId",
"value": "693c4d3e464d7d9e1396cf0e"
}
]
}
},
{
"rtId": "693c4d97464d7d9e1396cf0f",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "John"
},
{
"attributePath": "rtId",
"value": "693c4d97464d7d9e1396cf0f"
}
]
}
},
{
"rtId": "693c51af464d7d9e1396cf11",
"cells": {
"items": [
{
"attributePath": "contact.firstName",
"value": "John"
},
{
"attributePath": "rtId",
"value": "693c51af464d7d9e1396cf11"
}
]
}
}
]
}
}
]
}
}
}
}

Parameters

ParameterTypeRequiredDescription
ckIdStringYesThe construction kit type ID to query
columnPaths[String!]YesList of attribute paths to include as columns
firstIntNoNumber of rows to return (pagination)
afterStringNoCursor for pagination
searchFilterSearchFilterNoText search filter
fieldFilter[FieldFilter]NoAttribute-based filters
sortOrder[Sort]NoSort order for results

Transient queries vs regular queries

AspectRegular QueryTransient Query
Column definitionFixed in GraphQL queryDynamic via columnPaths
Response formatTyped object structureTable structure (rows/cells)
Type safetyFull GraphQL type safetyValues returned as generic value
Use caseKnown data structureDynamic/configurable views
PerformanceOptimized for specific fieldsSlightly more overhead

Use regular queries when the data structure is known at development time. Use transient queries for dynamic scenarios like user-configurable data grids.