From 7cebbfe00dc3c360e80e8962f345a28743b49c1f Mon Sep 17 00:00:00 2001 From: enisdenjo Date: Sat, 14 Nov 2020 23:49:42 +0100 Subject: [PATCH] fix(message): Allow `payload` field to be of any type for `NextMessage` Re-closes: #72 --- src/message.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/message.ts b/src/message.ts index 8882151d..3b9fb3bb 100644 --- a/src/message.ts +++ b/src/message.ts @@ -120,10 +120,7 @@ export function isMessage(val: unknown): val is Message { case MessageType.Next: return ( hasOwnStringProperty(val, 'id') && - hasOwnObjectProperty(val, 'payload') && - // ExecutionResult - (hasOwnProperty(val.payload, 'data') || // data - hasOwnObjectProperty(val.payload, 'errors')) // or error(s) + hasOwnObjectProperty(val, 'payload') ); case MessageType.Error: return hasOwnStringProperty(val, 'id') && areGraphQLErrors(val.payload);