Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http server api #8

Merged
merged 4 commits into from May 30, 2019
Merged

Http server api #8

merged 4 commits into from May 30, 2019

Conversation

gobengo
Copy link
Contributor

@gobengo gobengo commented May 29, 2019

Adds support for two new library APIs to add graphql-ws over WebSocket-Over-Http support to a broader class of node.js projects, not just those using express.

  • http-request-listener-api - Operates on http.RequestListener and returns the same type, but one that will do graphl-ws over WebSocket-Over-Http before deferring to the provided RequestListener. This example uses apollo-server-micro to produce the logic used by the sample RequestListener, but any RequestListener would work (e.g. those in the node http docs)
  • http-server-api Operates on http.Servers (which can be created from an http.RequestListener, but some libraries only make servers and not RequestListeners), patching it to intercept requests and first run them through GraphqlWsOverWebSocketOverHttpExpressMiddleware

Note that the interface of micro's default export is going to change in 9.3.5 (next release) to return an http.RequestListener whereas historically it has returned an http.Server (vercel/micro#399).
Pretty big change. Hopefully they do it as a major semver bump since it seems like it will be backward incompatible).

@gobengo gobengo merged commit 7dd4642 into master May 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant