Join Eric Greene for an in-depth discussion in this video Mutating client state with a mutation query: Mutations, part of Apollo Client State with React.
- [Instructor] So now what I'm going to do…is I'm going to close this file for right now.…This one is looking good.…I'm going to come back over to WidgetsQuery…and at the top I'm actually going to go ahead and import…from the mutations folder.…I'll come over here and pull in my DeleteWidgetMutation.…I'm going to take the DeleteWidgetMutation here…and use it for my return.…And into it I'm actually going to pass the widgets…which I'm going to get off of my data.widgets.…
Also too, I am going to need to be getting…my actual selected ids pulled in as well,…as well as some other client states.…So we'll come back and wire that up here shortly…once we're ready to start actually working with our delete.…So now let's go ahead and finish making use…of these new components so we can actually load our page.…So coming into here what we're going to do is at the top…I'm going to pull in, no longer need that…and I no longer need WidgetTable,…but I am going to need to pull in my…WidgetsQuery…from my queries here.…
So there's my WidgetsQuery I'm going to pull in.…
Share this video
Embed this video
Video: Mutating client state with a mutation query: Mutations