(futuristic music)…- [Narrator] In addition to querying our client state,…we also have the ability to mutate it.…One of the ways in which we can mutate it…is we can actually do mutation queries.…Just like the mutation queries we send to the server,…we can send mutation queries to the client state…and we can actually implement mutation operations…in the client state resolvers.…
So take a look here.…We're going to actually implement…a function called addSelectedWidgetId.…Now we'll actually do a demonstration of this with our code…when we get to the demo,…but the basic idea of the addSelectedWidgetId is…you can go and select a bunch of widgets…in a table of widgets.…So as you select each widget,…we want to capture that id and an array of selected ids.…Well, when we go to add those ids,…we are mutating, we are mutating the client state…by adding in that new id.…
And so we can actually write a mutation here…that will actually handle that for us…and then in our resolver write some code…which will actually reach out to the cache,…
Skill Level Advanced
GraphQL Essential Training (2018)with Emmanuel Henri1h 54m Intermediate
React.js Essential Training (2018)with Eve Porcello1h 25m Intermediate
1. Apollo Client State with React
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.