Skip to content

Commit

Permalink
fix(message): Allow payload field to be of any type for NextMessage
Browse files Browse the repository at this point in the history
Re-closes: #72
  • Loading branch information
enisdenjo committed Nov 14, 2020
1 parent 1a16522 commit 7cebbfe
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7cebbfe

Please sign in to comment.