Join Eric Greene for an in-depth discussion in this video Configuring and querying client state: Demo, part of Apollo Client State with React.
(insightful music)…- [Instructor] Let's do a demonstration now…of configuring and querying Client State.…Let's go ahead and get started putting together…our Client State configuration,…and demonstrate a query pulling some of that data…out of our client state.…To do this, we're going to open up our source folder here.…And inside of our source folder,…we're going to open up our index.js file.…Here at the top, we're going to need to import…a couple of things to be able to make this happen.…First, you see where we have out import split,…we'll need to pull in the Apollo…Link, clasp so we can actually do the from option…to actually combine the Client State…with the actual HTTP link.…
Down here, we're going to be importing…our withClientState…and we're going to import that from…our apollo-link-state there.…We'll need to do is actually configure this ClientState…so that we can include it in our link configuration…for the apollo client.…I'm going to take the withClientState right here,…come down here and say const…clientStateLink…
Share this video
Embed this video
Video: Configuring and querying client state: Demo