GraphQL offers an alternative mechanism for fetching data, but it's not just a drop-in replacement for the fetch API. In providing a layer of abstraction above HTTP calls, it offers a whole bunch of additional features that can be added to all of your requests with little effort.
The system has a reputation for being advanced or complicated, but, as we'll see in this chapter, it's really nothing harder than the fetch API, particularly if you're following TDD.
We'll use the Relay library to connect to our backend. This is a bare-bones GraphQL implementation that does the job well and without too much magic. If you're using other GraphQL libraries in place of Relay, the techniques we'll explore in this chapter will also apply.
We're going to build a new CustomerHistory component that displays details of a customer, together...