Skip to main content

executeView

client.knowledgeGraph.executeView(id: string, params?: Record<string, unknown>): Promise<unknown>

Executes a view and returns the query results.

Runs the view's query against its associated graph instance and returns the matching records and edges. This is the primary way to extract data from a knowledge graph.

Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the view to execute
paramsRecord<string, unknown>NoOptional runtime parameters to pass to the view query

Returns

Promise<unknown> — A promise that resolves to the query results (records and edges)

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.knowledgeGraph.executeView('id');
console.log(result);