From 533248e0bcfd857c7960c9e8671cbd300788ad7d Mon Sep 17 00:00:00 2001 From: enisdenjo Date: Sat, 14 Nov 2020 23:25:59 +0100 Subject: [PATCH] fix(message): Allow `data` field to be of any type Closes: #72 --- src/message.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/message.ts b/src/message.ts index 07706fff..8882151d 100644 --- a/src/message.ts +++ b/src/message.ts @@ -122,8 +122,8 @@ export function isMessage(val: unknown): val is Message { hasOwnStringProperty(val, 'id') && hasOwnObjectProperty(val, 'payload') && // ExecutionResult - (hasOwnObjectProperty(val.payload, 'data') || - hasOwnObjectProperty(val.payload, 'errors')) + (hasOwnProperty(val.payload, 'data') || // data + hasOwnObjectProperty(val.payload, 'errors')) // or error(s) ); case MessageType.Error: return hasOwnStringProperty(val, 'id') && areGraphQLErrors(val.payload);