apollographql / subscriptions-transport-ws

:arrows_clockwise: A WebSocket client + server for GraphQL subscriptions
https://www.npmjs.com/package/subscriptions-transport-ws
MIT License
1.52k stars 342 forks source link

How to fix 'Cannot read property 'id' of 'null' #876

Closed WakilAhmadOmar closed 2 years ago

WakilAhmadOmar commented 3 years ago

This error occurs when I use real time. message: "Cannot read property 'id' of null" name: "TypeError"

const subscriptionData = client.subscribe({ query: ........................................., variables: { ...variables }, }) .subscribe({ next: ({data:{...............................}}) => { console.log("........................"); },error: (error) => { console.log(" .................... error", JSON.stringify(error, null, 3)); }, });

Output image