graphile-build
Advanced tools
Comparing version 4.0.0-rc.5 to 4.0.0-rc.6
@@ -13,4 +13,4 @@ "use strict"; | ||
const base64 = str => new Buffer(String(str)).toString("base64"); | ||
const base64Decode = str => new Buffer(String(str), "base64").toString("utf8"); | ||
const base64 = str => Buffer.from(String(str)).toString("base64"); | ||
const base64Decode = str => Buffer.from(String(str), "base64").toString("utf8"); | ||
@@ -17,0 +17,0 @@ exports.default = function NodePlugin(builder, { nodeIdFieldName: inNodeIdFieldName }) { |
@@ -199,8 +199,10 @@ "use strict"; | ||
async watchSchema(listener) { | ||
if (this._watching || this._busy) { | ||
throw new Error("We're already watching this schema!"); | ||
if (this._busy) { | ||
throw new Error("An operation is in progress"); | ||
} | ||
if (this._watching) { | ||
throw new Error("We're already watching this schema! Use `builder.on('schema', callback)` instead."); | ||
} | ||
try { | ||
this._busy = true; | ||
this._watching = true; | ||
this._explicitSchemaListener = listener; | ||
@@ -222,9 +224,10 @@ this.triggerChange = () => { | ||
}; | ||
for (const fn of this.watchers) { | ||
await fn(this.triggerChange); | ||
} | ||
if (listener) { | ||
this.on("schema", listener); | ||
} | ||
for (const fn of this.watchers) { | ||
await fn(this.triggerChange); | ||
} | ||
this.emit("schema", this.buildSchema()); | ||
this._watching = true; | ||
} finally { | ||
@@ -236,3 +239,6 @@ this._busy = false; | ||
async unwatchSchema() { | ||
if (!this._watching || this._busy) { | ||
if (this._busy) { | ||
throw new Error("An operation is in progress"); | ||
} | ||
if (!this._watching) { | ||
throw new Error("We're not watching this schema!"); | ||
@@ -239,0 +245,0 @@ } |
{ | ||
"name": "graphile-build", | ||
"version": "4.0.0-rc.5", | ||
"version": "4.0.0-rc.6", | ||
"description": "Build a GraphQL schema from plugins", | ||
"main": "node8plus/index.js", | ||
"types": "node8plus/index.d.ts", | ||
"scripts": { | ||
"test": "jest", | ||
"prepack": "mkdir -p node8plus && babel -s true --out-dir node8plus src && flow-copy-source src node8plus", | ||
"watch": "mkdir -p node8plus && babel -s true --watch --out-dir node8plus src" | ||
"prepack": "mkdir -p node8plus && babel --copy-files -s true --out-dir node8plus src && flow-copy-source src node8plus", | ||
"watch": "mkdir -p node8plus && babel --copy-files -s true --watch --out-dir node8plus src" | ||
}, | ||
@@ -30,4 +31,5 @@ "repository": { | ||
"dependencies": { | ||
"@types/graphql": "0.13.4", | ||
"debug": ">=2 <3", | ||
"graphql-parse-resolve-info": "4.0.0-rc.4", | ||
"graphql-parse-resolve-info": "4.0.0-rc.6", | ||
"lodash": ">=4 <5", | ||
@@ -44,3 +46,3 @@ "lru-cache": ">=4 <5", | ||
"flow-copy-source": "^1.2.0", | ||
"jest": "^20.0.4" | ||
"jest": "23.5.0" | ||
}, | ||
@@ -47,0 +49,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
233737
50
1592
7
+ Added@types/graphql@0.13.4
+ Added@types/graphql@0.13.4(transitive)
+ Addedgraphql-parse-resolve-info@4.0.0-rc.6(transitive)
- Removedgraphql-parse-resolve-info@4.0.0-rc.4(transitive)