diff --git a/packages/core/src/groq.ts b/packages/core/src/groq.ts index 65738d258..b31e0813b 100644 --- a/packages/core/src/groq.ts +++ b/packages/core/src/groq.ts @@ -3,11 +3,18 @@ import { parse, evaluate } from "groq-js" * Loads and applies GROQ transformation to the input data * @param input */ -export async function GROQEvaluate(query: string, dataset: any): Promise { +export async function GROQEvaluate( + query: string, + dataset: any, + options?: { + root?: any + params?: Record + } +): Promise { if (dataset === undefined) return dataset const tree = parse(query) - const value = await evaluate(tree, { dataset }) + const value = await evaluate(tree, { dataset, ...(options || {}) }) const res = await value.get() return res }