Closed mchccn closed 2 years ago
Yep! I updated the README as well to feature this if it ever gets merged.
Related: #223
@glasser This is something that should be added to the v3.0 release: https://github.com/apollographql/graphql-subscriptions/milestone/1
This has been out here for a while: https://github.com/contra/typed-graphql-subscriptions
The class PubSub now has a generic type parameter so its methods
publish
andsubscribe
can be optionally type-checked by TypeScript./label typedefs
I was using
apollo-server-express
but the classPubSub
did not have any compile time validation by TypeScript. So I extended the class and added a generic. I thought I would contribute to the project back since it will be useful to others.New usage: