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
| Parameter | Type | Required | Description |
|---|---|---|---|
ckId | String | Yes | The construction kit type ID to query |
columnPaths | [String!] | Yes | List of attribute paths to include as columns |
first | Int | No | Number of rows to return (pagination) |
after | String | No | Cursor for pagination |
searchFilter | SearchFilter | No | Text search filter |
fieldFilter | [FieldFilter] | No | Attribute-based filters |
sortOrder | [Sort] | No | Sort order for results |
Transient queries vs regular queries
| Aspect | Regular Query | Transient Query |
|---|---|---|
| Column definition | Fixed in GraphQL query | Dynamic via columnPaths |
| Response format | Typed object structure | Table structure (rows/cells) |
| Type safety | Full GraphQL type safety | Values returned as generic value |
| Use case | Known data structure | Dynamic/configurable views |
| Performance | Optimized for specific fields | Slightly 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.