graphql-go/graphql

Notification/subscription support

iketheadore opened this issue · 6 comments

Hey guys:

Thanks for all your awesome works, and do we have notification/subscription supported now?

There was a previous discussion here: #49

I am currently making myself familiar with this topic as well and from what I can see the building
blocks are all in place, but currently you have to go the extra mile yourself.

As far as I can see you have to do basically the following:

  • parse your query to get the AST
  • validate it with your schema and potentially other rule functions
  • setup your pubsub system (possibly using the arguments/variables)
  • for every message received by the pubsub system execute your query and and inject the received message as RootObject and send the result to the client

Similar to the extension library for the JS graphql library:
https://dev-blog.apollodata.com/a-proposal-for-graphql-subscriptions-1d89b1934c18

I implemented the same pattern for graphql-go:
https://github.com/trevex/graphql-go-subscription/blob/master/examples/simple.go

It still fairly untested and immature (completely misses the transport stuff), but let me know what you think. Feel free to report bugs or submit PRs (although I am on holiday soonish).

Any updates for this issue?

Also interested

ulm0 commented

Looking forward into this as well.

Hi guys, thanks a lot for your awesome feedback! 👍 — really appreciate it, subscriptions is being supported in the lib for a while now, closing this one, you might want to take a look to the example shown in a related GitHub comment: #49 (comment)