vesper-framework / vesper

Vesper is a NodeJS framework that helps you to create scalable, maintainable, extensible, declarative and fast GraphQL-based server applications.
http://vesper-framework.com
600 stars 35 forks source link

Fix #38 #40 resolver in subscription #39

Open josephktcheung opened 6 years ago

josephktcheung commented 6 years ago

This is to fix #38. Since there are no CurrentRequest, CurrentResponse and dataLoaders in the context / container when it's subscription, the resolver will fail when it tries to access those from context in buildCustomResolvers.

Since CurrentRequest and CurrentResponse can be undefined in subscriptions, I use the try catch to check if those 2 keys exists in the Container.

I also set dataLoaders to an empty array in context when a new subscriber connects to server.

josephktcheung commented 6 years ago

Also fix #40 by adding connectionParams to context so that user can use setUpContainer callback to implement authentication (similar to sample 10)

otonielguajardo commented 5 years ago

Any update on this? This is an awesome framework! would be a shame to stop updating it