Skip to Main Content
Mastering React Test-Driven Development - Second Edition
book

Mastering React Test-Driven Development - Second Edition

by Daniel Irvine
September 2022
Intermediate to advanced content levelIntermediate to advanced
564 pages
9h 56m
English
Packt Publishing
Content preview from Mastering React Test-Driven Development - Second Edition

13

Test-Driving GraphQL

GraphQL offers an alternative to HTTP requests for fetching data. It offers a whole bunch of additional features that can be added to data requests.

As with Redux, GraphQL systems can seem complicated, but TDD helps to provide an approach to understanding and learning.

In this chapter, we’ll use the Relay library to connect to our backend. We’re going to build a new CustomerHistory component that displays details of a single customer and their appointment history.

This is a bare-bones GraphQL implementation that shows the fundamentals of test-driving the technology. If you’re using other GraphQL libraries instead of Relay, the techniques we’ll explore in this chapter will also apply.

Here’s what the new CustomerHistory ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full-Stack Web Development with GraphQL and React - Second Edition

Full-Stack Web Development with GraphQL and React - Second Edition

Sebastian Grebe

Publisher Resources

ISBN: 9781803247120Supplemental Content