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.
Update resolvers for subscriptions
- Now we've got a schema on our server updated, so the next thing we need to update is our resolvers, still on the servers. So let's get to it. Before we do there's two little typos that I've seen, for example here there's and extra S, so let's remove that. This is on the server file here inside of the server folder. Remove the extra S. Save that. And also on the schema, this is not 'detaiis' but 'details', so let's make sure that this is fixed. This is on the schema inside of the source folder on the server. Save that as well. And then you can close those two files. Okay. What we're going to do first is import a few things. So let's go ahead and go above contacts here, and import PubSub which we're going to use when we work with our resolvers here. And withfilter. And this is for the subscription that we are going to create soon. And this is coming from graphql subscriptions. graphql-subscriptions, like so. And then lets create our pubsub variable which we'll use and create a new…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Introduction to subscriptions and schema9m 18s
-
(Locked)
Update resolvers for subscriptions10m 22s
-
(Locked)
Update components for subscriptions9m 6s
-
(Locked)
Create a custom resolver on client6m 2s
-
(Locked)
Add new contact header component5m 14s
-
(Locked)
Connect subscription with contact single14m 18s
-
(Locked)
Adding new notes with mutations15m 47s
-
(Locked)
Finalizing project with a beauty pass12m 13s
-
(Locked)
-