@graphql-live/client
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -19,3 +19,3 @@ import { ExecutionResult } from "graphql"; | ||
id: number; | ||
context: any; | ||
context?: any; | ||
operation: Operation; | ||
@@ -25,4 +25,4 @@ }; | ||
id: number; | ||
result: ExecutionResult; | ||
isFinal?: boolean; | ||
result: ExecutionResult; | ||
}; | ||
@@ -35,4 +35,5 @@ export declare type Operation = { | ||
export declare function createClient({ url, context, socketOptions }?: ClientOptions): { | ||
socket: import("socket.io-client").Socket; | ||
execute: (operation: Operation, observer: ResultObserver) => () => void; | ||
destroy: () => void; | ||
}; |
@@ -26,3 +26,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
}; | ||
const onOperationResult = ({ id, isFinal, result }) => { | ||
const onOperationResult = ({ id, result, isFinal }) => { | ||
const record = operations.get(id); | ||
@@ -63,3 +63,3 @@ if (!record) | ||
return () => { | ||
socket.emit("graphql:unsubscribe", { id }); | ||
socket.emit("graphql:unsubscribe", id); | ||
operations.delete(id); | ||
@@ -70,2 +70,3 @@ observer.complete(); | ||
return { | ||
socket, | ||
execute, | ||
@@ -72,0 +73,0 @@ destroy |
{ | ||
"name": "@graphql-live/client", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "The client part of the GraphQLive package", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -23,3 +23,3 @@ import { ExecutionResult } from "graphql"; | ||
id: number; | ||
context: any; | ||
context?: any; | ||
operation: Operation; | ||
@@ -30,4 +30,4 @@ }; | ||
id: number; | ||
result: ExecutionResult; | ||
isFinal?: boolean; | ||
result: ExecutionResult; | ||
}; | ||
@@ -62,3 +62,3 @@ | ||
const onOperationResult = ({ id, isFinal, result }: ResultPayload) => { | ||
const onOperationResult = ({ id, result, isFinal }: ResultPayload) => { | ||
const record = operations.get(id); | ||
@@ -85,3 +85,3 @@ if (!record) return; | ||
const id = currentId++; | ||
const record = { | ||
const record: OperationRecord = { | ||
observer, | ||
@@ -100,3 +100,3 @@ async execute() { | ||
return () => { | ||
socket.emit("graphql:unsubscribe", { id }); | ||
socket.emit("graphql:unsubscribe", id); | ||
operations.delete(id); | ||
@@ -108,2 +108,3 @@ observer.complete(); | ||
return { | ||
socket, | ||
execute, | ||
@@ -110,0 +111,0 @@ destroy |
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
153620
261