Adding GraphQL to the stack

We need to add two components to import GraphQL into our app. We need a client GraphQL library and a GraphQL server. Although it is a pretty new technology, there are quite a few options for GraphQL server and client already. There is a list of JavaScript client and server libraries at https://github.com/chentsulin/awesome-graphql#lib-js. For this demo, we will use Apollo client. Apollo is an open source GraphQL client and server developed by the Meteor team (Meteor Development Group).

To install all the libraries, we need to execute the following commands:

>> meteor add apollo>> npm install apollo-client --save>> npm install graphql-server-express --save>> npm install express --save>> npm install graphql --save ...

Get Build Applications with Meteor now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.