Skip to Main Content
React Projects
book

React Projects

by Roy Derks
December 2019
Intermediate to advanced content levelIntermediate to advanced
474 pages
10h 3m
English
Packt Publishing
Content preview from React Projects

Managing local state

Not only can you use Apollo Client to manage the data that is fetched from the GraphQL server, but you can also use it for managing the local state. With Apollo, it becomes easy to combine local state with data from the GraphQL server since you can also use queries and mutations to deal with the local state.

A good example of information you might want to put in your local state for this e-commerce store is the number of products that should be requested from the GraphQL server. In the first part of this chapter, you already created a query that takes a parameter called limit, which defines how many products will be returned.

To add local state to your application, some changes need to made to the setup of Apollo Client, ...

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

React Projects - Second Edition

React Projects - Second Edition

Roy Derks
Test-Driven React

Test-Driven React

Trevor Burnham

Publisher Resources

ISBN: 9781789954937Supplemental Content