apollographql / graphql-subscriptions

:newspaper: A small module that implements GraphQL subscriptions for Node.js
MIT License
1.59k stars 133 forks source link

Subscription returns null to subscribed client #190

Closed jomaint closed 5 years ago

jomaint commented 5 years ago

Hi,

Im currently stuck for several days trying to return my payload to my subscribed clients from apollo-server. Somehow the subscribed client did receive the push from server but all values are null. I have verified via 'resolve' on Subscription resolver that my payload is published correctly. But it always reaches my clients with null. I have even resorted to hardcoding my payload and pushing it manually. I have also double checked that my key in payload is 'addedPlace'. Im pretty sure somewhere between subscription resolve function & my client is where the problem is. Hope to hear from anyone who has a clue

Subscription resolve function log screenshot 2019-01-15 at 11 59 23 am

Client received payload screenshot 2019-01-15 at 11 45 22 am

Server graphql: 14.0.2 apollo-server-express: 2.3.1 subscriptions-transport-ws: 0.9.14 graphql-subscriptions: 1.0.0 graphql-tools: 4.0.3

locnguyen commented 4 years ago

@jomaint what was your resolution for this problem? I’m trying to figure out the same for my app.

OBannon37 commented 2 years ago

Ran into the same symptom. Looks like you should be returning payload.addedPlace instead of payload, see https://github.com/apollographql/graphql-subscriptions/issues/113