Starting with Apollo Boost

This lesson introduces to Apollo Client with Apollo Boost which we will use to execute GraphQL queries.

The application in this chapter will start from introducing Apollo Client with Apollo Boost. The latter allows you to create a zero-configuration Apollo Client to get you started with the fastest and most convenient way.

This chapter focuses on the Apollo Client instead of React for the sake of learning.

In the upcoming lessons, you will consume GitHub’s GraphQL API, and then output the queries and mutation results in the command line. To do this, you will need a personal access token on GitHub’s website, which we covered in one of the previous chapters.

Apollo-Boost Package

The apollo-boost package gives access to a zero-configuration Apollo Client, and the graphql package allows GraphQL queries, mutations, and subscriptions on both the client and server. It is JavaScript’s reference implementation of Facebook’s GraphQL specification.

In the next steps, you will configure and use the Apollo Client that comes with Apollo Boost in the index.js file of the project. The project stays small, and you will only implement it in this section, so, for now, we can have everything in one file for the sake of learning.

In your index.js file, we import the Apollo Client from Apollo Boost. After that, we create a client instance by calling its constructor with a URI. The client needs to know where the data comes from, and where it should be written, so you can pass GitHub’s API endpoint to it.

Get hands-on with 1200+ tech skills courses.