Code here: https://gist.github.com/RedShift1/cb60eb8fc67fbfc7cd823e907dd445d9
Database from https://github.com/acarl005/join-monster-graphql-tools-adapter/tree/master/db
The only change I made compared to the example was in the user resolver, wrapping the "return joinMonster" in a Promise.then(), because require('sqlite').open(...) returns a Promise.
Result:
C:\tmp\test>node index.js
{ data: { user: null } }
Dependency versions:
"dependencies": {
"graphql": "^0.12.3",
"graphql-tools": "^2.14.1",
"join-monster": "^2.0.15",
"join-monster-graphql-tools-adapter": "0.0.2",
"sqlite": "^2.9.0"
},
Code here: https://gist.github.com/RedShift1/cb60eb8fc67fbfc7cd823e907dd445d9
Database from https://github.com/acarl005/join-monster-graphql-tools-adapter/tree/master/db
The only change I made compared to the example was in the user resolver, wrapping the "return joinMonster" in a Promise.then(), because require('sqlite').open(...) returns a Promise.
Result:
Dependency versions:
"dependencies": {
"graphql": "^0.12.3",
"graphql-tools": "^2.14.1",
"join-monster": "^2.0.15",
"join-monster-graphql-tools-adapter": "0.0.2",
"sqlite": "^2.9.0"
},