graphql-ws
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -13,2 +13,3 @@ "use strict"; | ||
const events_1 = require("events"); | ||
const jiff = require("jiff"); | ||
const message_type_1 = require("./message-type"); | ||
@@ -241,2 +242,3 @@ const protocol_1 = require("./protocol"); | ||
}).then(({ executionIterable, params }) => { | ||
let lastVal; | ||
iterall_1.forAwaitEach(iterall_1.createAsyncIterator(executionIterable), (value) => __awaiter(this, void 0, void 0, function* () { | ||
@@ -253,2 +255,9 @@ let result = value; | ||
} | ||
if (lastVal) { | ||
result = { data: { __patch: jiff.diff(lastVal.data, value.data, { invertible: false }) } }; | ||
} | ||
else { | ||
result = value; | ||
} | ||
lastVal = value; | ||
SubscriptionServer.sendMessage(connectionContext, opId, message_type_1.MessageType.GQL_DATA, result); | ||
@@ -255,0 +264,0 @@ })).then(() => __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "graphql-ws", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"description": "WebSocket transport for GraphQL", | ||
@@ -16,2 +16,3 @@ "main": "dist/index.js", | ||
"iterall": "^1.1.1", | ||
"jiff": "^0.7.3", | ||
"lodash.assign": "^4.2.0", | ||
@@ -18,0 +19,0 @@ "lodash.isobject": "^3.0.2", |
@@ -21,5 +21,4 @@ interface Array<T> { | ||
declare module 'backo2'; | ||
declare module 'readable-stream'; | ||
declare module 'class-autobind'; | ||
declare module 'jiff'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
501076
10556
12
+ Addedjiff@^0.7.3
+ Addedjiff@0.7.3(transitive)