Skip to content

Commit

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

0 comments on commit 533248e

Please sign in to comment.