rsocket-js icon indicating copy to clipboard operation
rsocket-js copied to clipboard

feat: apollo graphql link and server

Open viglucci opened this issue 3 years ago • 2 comments

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.

viglucci avatar May 08 '22 04:05 viglucci

Moving this PR out of draft is pending investigating Apollo's executeOperation, as suggested here.

viglucci avatar May 25 '22 14:05 viglucci

I will fix DCO on merge.

viglucci avatar Sep 04 '22 23:09 viglucci

Rebased to fix resolve DCO check issue.

viglucci avatar Apr 27 '23 01:04 viglucci