Skip to content

Commit 6d6b211

Browse files
committed
extend DataSource for TS types
1 parent 4ad75a0 commit 6d6b211

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

SQLDataSource.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
const SQLCache = require("./SQLCache");
1+
const DataSource = require("apollo-datasource");
22
const knexTinyLogger = require("knex-tiny-logger").default;
3+
const SQLCache = require("./SQLCache");
34

45
const { DEBUG } = process.env;
56

6-
class SQLDataSource {
7+
class SQLDataSource extends DataSource {
78
initialize(config) {
89
if (DEBUG) knexTinyLogger(this.knex); // Add a logging utility for debugging
910
this.context = config.context;

package-lock.json

Lines changed: 28 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
},
3838
"homepage": "https://github.com/cvburgess/SQLDataSource#readme",
3939
"dependencies": {
40+
"apollo-datasource": "^0.1.3",
4041
"apollo-server-caching": "^0.1.2",
4142
"dataloader": "^1.4.0",
4243
"knex-tiny-logger": "^1.1.0"

0 commit comments

Comments
 (0)