@coderich/autograph 0.9.10 → 0.9.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coderich/autograph",
3
3
  "author": "Richard Livolsi (coderich)",
4
- "version": "0.9.10",
4
+ "version": "0.9.11",
5
5
  "description": "AutoGraph",
6
6
  "keywords": [
7
7
  "graphql",
@@ -71,6 +71,10 @@ module.exports = class Resolver {
71
71
  return new DataTransaction(this, parentTxn);
72
72
  }
73
73
 
74
+ disconnect(model) {
75
+ return this.toModelEntity(model).getDriver().disconnect();
76
+ }
77
+
74
78
  resolve(query) {
75
79
  const { model, crud } = query.toObject();
76
80
 
@@ -16,6 +16,10 @@ module.exports = class MongoDriver {
16
16
  return MongoClient.connect(uri, options);
17
17
  }
18
18
 
19
+ disconnect() {
20
+ return this.connection.then(client => client.close());
21
+ }
22
+
19
23
  raw(collection) {
20
24
  return proxyPromise(this.connection.then(client => client.db().collection(collection)));
21
25
  }
@@ -7,8 +7,8 @@ const { validateSchema, makeExecutableSchema, mergeASTSchema, mergeASTArray } =
7
7
  const Node = require('./Node');
8
8
  const Model = require('./Model');
9
9
 
10
- const loadFile = file => FS.readFileSync(Path.resolve(file), 'utf8');
11
- const reqFile = file => require(Path.resolve(file)); // eslint-disable-line global-require,import/no-dynamic-require
10
+ const loadFile = file => FS.readFileSync(file, 'utf8');
11
+ const reqFile = file => require(file); // eslint-disable-line global-require,import/no-dynamic-require
12
12
 
13
13
  module.exports = class Schema extends Node {
14
14
  constructor(schema) {