How to Add Apollo Server for a GraphQL API in a Node.js App
Installing Apollo Server and GraphQL#
In the lesson video, we show how we install the additional typings for the
graphqllibrary from the DefinitelyTyped repository. As of now, however, we'll no longer need to install the community provided typings since the
graphqllibrary now provides its own type definitions!
We've mentioned that the GraphQL specification isn't tied to any specific technology. We've also talked about one of the popular suite of tools in the GraphQL ecosystem, Apollo.
Apollo Server is one of the libraries within the Apollo framework and its responsibility is to help build a GraphQL API within Node applications. Apollo Server enables us to connect a GraphQL schema to a server and can be used to spin up a stand-alone server, be an add-on to an existing Node server, or even work within "serverless" environments. We'll go with the approach of adding Apollo Server to our existing Node/Express server.