diff --git a/CHANGELOG.md b/CHANGELOG.md index 57a28db5..213c634e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,12 @@ for upgrading your code to arangojs v9. the behavior of other ArangoDB drivers and help detect normalization issues in user code. +- Changed return type of `aql` and the AQL `join` helper function to `AqlQuery` + + Previously the internal `GeneratedAqlQuery` type was exposed as the return + type of these functions, leading to complexity when handling generic type + arguments. + ## [8.6.0] - 2023-10-24 ### Added diff --git a/src/aql.ts b/src/aql.ts index 9a4e4f56..8e212803 100644 --- a/src/aql.ts +++ b/src/aql.ts @@ -206,7 +206,7 @@ export function isAqlLiteral(literal: any): literal is AqlLiteral { export function aql( templateStrings: TemplateStringsArray, ...args: AqlValue[] -): GeneratedAqlQuery { +): AqlQuery { const strings = [...templateStrings]; const bindVars: Record = {}; const bindValues = []; @@ -264,7 +264,7 @@ export function aql( query, bindVars, _source: () => ({ strings, args }), - }; + } as AqlQuery; } /** @@ -399,7 +399,7 @@ export function literal( * // @value1 -> "users" * ``` */ -export function join(values: AqlValue[], sep: string = " "): GeneratedAqlQuery { +export function join(values: AqlValue[], sep: string = " "): AqlQuery { if (!values.length) { return aql``; }