rsocket-js
rsocket-js copied to clipboard
feat: apollo graphql link and server
Adds experimental ApolloLink and ApolloServer implementations to support GraphQL over RSocket with Apollo GraphQL.
Motivation:
Spring recently added support for GraphQL over RSocket, and we were interested to see if we could provide similar support via rsocket-js. This addition will provide a mechanism for consuming RSocket transport using GraphQL servers via JS clients (browser etc.).
Additionally, these additions provide an interesting alternative to existing Apollo GraphQL subscription links, such as graphql-ws. Existing GraphQL subscription users could now benefit from a potentially increased number of available transport protocol options. I believe it would be beneficial for these advancements to be more broadly broadcasted and advocated for in the GraphQL community.
Modifications:
- added rsocket-graphql-apollo-link package
- added rsocket-graphql-apollo-server package
- provided examples for using new packages
Result:
See above.
Related:
- https://github.com/apollographql/apollo-server/issues/6264
- https://community.apollographql.com/t/runhttpquery-alternative-for-non-http-frameworks-apolloserver-rsocket-integration/3125
Open questions/items:
- Are we improperly assuming a route will be used/required on the server?
- Are we sending the proper metadata mime type on SETUP and request?
- Are errors being handled according to spec?
- Test Interop with Spring server/client.
Moving this PR out of draft is pending investigating Apollo's executeOperation, as suggested here.
I will fix DCO on merge.
Rebased to fix resolve DCO check issue.