Skip to content

Commit

Permalink
Replace GeneratedAqlQuery with AqlQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
pluma4345 committed Oct 24, 2023
1 parent d317132 commit b660377
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/aql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export function isAqlLiteral(literal: any): literal is AqlLiteral {
export function aql<T = any>(
templateStrings: TemplateStringsArray,
...args: AqlValue[]
): GeneratedAqlQuery<T> {
): AqlQuery<T> {
const strings = [...templateStrings];
const bindVars: Record<string, any> = {};
const bindValues = [];
Expand Down Expand Up @@ -264,7 +264,7 @@ export function aql<T = any>(
query,
bindVars,
_source: () => ({ strings, args }),
};
} as AqlQuery<T>;
}

/**
Expand Down Expand Up @@ -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``;
}
Expand Down

0 comments on commit b660377

Please sign in to comment.