andyrichardson / subscriptionless

GraphQL subscriptions (and more) on serverless infrastructure
MIT License
93 stars 3 forks source link

Use alongside Apollo Server #24

Closed oyed closed 3 years ago

oyed commented 3 years ago

From what I can gather from the README, this seems like it's a replacement to running a GraphQL Server, like Apollo, and executing Queries/Mutations over WebSocket as well.

Would it be possible to run it alongside an Apollo instance, purely to handle Subscription? My immediate thought was to just pass the same schema to createInstance that I do to Apollo, and use createInstance for the publish function via my existing Context.

oyed commented 3 years ago

I also make heavy use of Apollo Client and it's client-side caching, since this uses graphql-ws, would integrating the connection over the graphql-ws client work out-of-the-box if I were to move away from Apollo Server to subscriptionless?

Regardless, love what you're doing here - I've never found any good, working, well maintained Subscriptions over API Gatewat (Or serverless in general) :)

andyrichardson commented 3 years ago

Hey @oyed thanks for getting involved!

Would it be possible to run it alongside an Apollo instance, purely to handle Subscription?

Totally - you can configure your client to use HTTP/S for queries and mutations (this is usually a default) 👍

My immediate thought was to just pass the same schema to createInstance that I do to Apollo, and use createInstance for the publish function via my existing Context.

That is exactly what I would recommend 🔥

I also make heavy use of Apollo Client and it's client-side caching, since this uses graphql-ws, would integrating the connection over the graphql-ws client work out-of-the-box

Check out the Apollo client example on the graphql-ws repo. The client side caching should be consistent regardless of what backend is being used for queries/mutations/subscriptions

Regardless, love what you're doing here

Thanks for the feedback - it means a lot! Definitely keep me posted if you encounter any issues or have any ideas for how this could be better!