-
-
Notifications
You must be signed in to change notification settings - Fork 821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic subscriptions support added to mergeSchemas and TypeRegistry. #463
Conversation
@shipiak: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
Looks good to me! Could you add the changelog entry, then I can merge. |
I'm also not 100% sure about the test at this moment, it would be nice if you could add test that simulates actual subscription event and checks that both unmerged and merged schemas work. |
Yeah, you are right I was bit too quick with PR :) Subscription resolvers are not working correctly on merged schema and cannot figure why. Still studying how delegating of resolvers work, but maybe it could be connected to subscription resolver having different structure? It is not a function as in query or mutation but object with method
Would be happy for any pointers :) |
Try adding delegating resolver to "subscribe" http://dev.apollodata.com/tools/graphql-subscriptions/subscriptions-to-schema.html |
src/stitching/mergeSchemas.ts
Outdated
fullResolvers.Subscription = {}; | ||
} | ||
Object.keys(subscriptionType.getFields()).forEach(name => { | ||
fullResolvers.Subscription[name] = createDelegatingResolver( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so here it would be
fullResolvers.Subscription[name] = { subscribe: createDelegatingResolver(
I've added the comment where you should modify it. It might just work. :) |
Hi @freiksenet , Subscriptions in local schemas are now working correctly, however I would like to ask you to review change in Many thanks. |
Hi guys, Many thanks! |
Hi! Thanks! I was on holiday for two weeks and then had flu, so I didn't have chance to review it. I'll do it today. |
This looks awesome, thank you @shipiak. |
Any documentation related to this PR? |
#420 - FourTwenty :)
Added support for subscription type (subscriptions will work with local schema only).
TODO: