Skip to main content
Version: 0.8.x

Class: ComposeRuntime

runtime.ComposeRuntime

The ComposeRuntime class provides APIs to execute queries on a GraphQL schema generated from a RuntimeCompositeDefinition. It allows applications to interact with documents using known models on a Ceramic node.

It is exported by the runtime module.

import { ComposeRuntime } from '@composedb/runtime'

Constructors

constructor

new ComposeRuntime(params): ComposeRuntime

Parameters

NameType
paramsComposeRuntimeParams

Returns

ComposeRuntime

Accessors

context

get context(): Context

Context object used internally.

Returns

Context

Methods

execute

execute<Data>(document, variableValues?): Promise<ExecutionResult<Data, ObjMap<unknown>>>

Execute a GraphQL query from a DocumentNode and optional variables.

Type parameters

NameType
DataRecord<string, unknown>

Parameters

NameType
documentDocumentNode
variableValues?Record<string, unknown>

Returns

Promise<ExecutionResult<Data, ObjMap<unknown>>>


executeQuery

executeQuery<Data>(source, variableValues?): Promise<ExecutionResult<Data, ObjMap<unknown>>>

Execute a GraphQL query from its source and optional variables.

Type parameters

NameType
DataRecord<string, unknown>

Parameters

NameType
sourcestring | Source
variableValues?Record<string, unknown>

Returns

Promise<ExecutionResult<Data, ObjMap<unknown>>>