From the course: Learning Apollo

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Add new contact header component

Add new contact header component

From the course: Learning Apollo

Start my 1-month free trial

Add new contact header component

- [Instructor] So we need to create a component that will be used primarily to query GraphQL and password contact ID props so we can get our list of nodes for that user. And we also need that to be the title of the main page where we're going to have the list of nodes for that user. So this is the contact header here. So let's go ahead and code this. So the first thing I want you to do for contact header is import, again, GraphQL, and let's go ahead and pull and copy from this one here, like so. Paste it. All right, so what we're going to pass instead of props here, we're going to pass data and we're going to pass, like we did with contacts, actually, very similar. So let's go ahead and copy that, like so, and paste it here, and instead of contacts, we're passing a contact. And then we're going to do a lot of these same error states here. So let's go ahead and take a look at what we got here, so we'll use most of this, actually. So let's paste it here, like so. So basically, for…

Contents