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

Update resolvers for subscriptions

From the course: Learning Apollo

Start my 1-month free trial

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…

Contents