Member-only story
DEVELOPER EXPERIENCE
Everything I Discovered About GraphQL and Apollo
What I learned along the way

In the older ages of front end development, fetching data from Web APIs was a very boring process. Indeed, the data model was frozen, meaning that you faced one of these situations:
- The data model was too rich for your use case.
- Some pieces of data were missing.
- You needed to chain requests to get the expected data structure.
To overcome these situations (and ease front-end developer tasks), GraphQL was created. It provides a new way to fetch data from the back end. Instead of dealing with frozen data structures, GraphQL offers a query language which allows us to get only what we need.
In this article, I won’t explain how GraphQL works or how to set it up — Medium hosts many meaningful articles on GraphQL and Apollo, its client for web and mobile applications, and you can find documentation here:
And here:
In this article, I will share some tips I discovered when using GraphQL and Apollo to ease development and make the Apollo-related code reusable.
Disclaimer: most of the code snippets concerns Vue.js and Vue Apollo. Anyway, as I introduce concepts and hints, I would guess that they can be applied to any other JavaScript Framework supported by GraphQL and Apollo.