Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 03e8434

Browse files
Fix compatibility with older QueryVariables API (#137)
1 parent 67687e2 commit 03e8434

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## UNRELEASED
4+
5+
- Fix compatibility with older QueryVariables API [#137](https://github.com/hypermodeAI/functions-as/pull/137)
6+
37
## 2024-07-15 - Version 0.10.0
48

59
- Add functions and example for accessing PostgreSQL [#119](https://github.com/hypermodeAI/functions-as/pull/119)

src/assembly/compat.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,18 @@ export abstract class connection {
1717
return graphql.execute<TData>(hostName, statement, variables);
1818
}
1919
}
20+
21+
/**
22+
* @deprecated Import `graphql`, and use `graphql.Variables` instead.
23+
*/
24+
export class QueryVariables {
25+
private qv: graphql.Variables = new graphql.Variables();
26+
27+
public set<T>(name: string, value: T): void {
28+
this.qv.set(name, value);
29+
}
30+
31+
public toJSON(): string {
32+
return this.qv.toJSON();
33+
}
34+
}

0 commit comments

Comments
 (0)