Skip to content

Commit 9f39a70

Browse files
authored
v1.0.2
- Fix issue with repeated constructor calls
1 parent be6d482 commit 9f39a70

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ typings/
5959

6060
# next.js build output
6161
.next
62+
*.rdb

CHANGELOG.md

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

3+
## v1.0.2 - 10-07-2019
4+
5+
- Fix issue with repeated constructor calls
6+
37
## v1.0.1 - 09-18-2019
48

59
- Fix issue with Redis keys and values

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ class SQLDataSource extends DataSource {
1717
this.db = Knex(knexConfig);
1818

1919
const _this = this;
20-
Knex.QueryBuilder.extend("cache", function(ttl) {
21-
return _this.cacheQuery(ttl, this);
22-
});
20+
if (!this.db.cache) {
21+
Knex.QueryBuilder.extend("cache", function(ttl) {
22+
return _this.cacheQuery(ttl, this);
23+
});
24+
}
2325
}
2426

2527
initialize(config) {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "datasource-sql",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "SQL DataSource for Apollo GraphQL projects",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)