...

/

Serving over HTTP Using Node.js

Serving over HTTP Using Node.js

Learn how to serve GraphQL HTTP using Node.js.

HTTP is the mainstream choice for client-server protocol due to its simplicity. In this lesson, we’ll review a few best practices for setting up a GraphQL server to operate over HTTP.

Web request

Modern web frameworks use a pipeline model where requests are passed through a middleware stack, which are also called filters or plugins. As the request is processed through the framework pipeline, the server can reveal the request sent by the client and transform, override, or close it with a response. Given how the underlying web framework works, GraphQL should ideally be placed after the authentication middleware. This is so it can access our framework’s unique ...