-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Description
Hi, & first thanks for this tuto, really helpful to learn GraphQL
I'm facing an understanding issue.
I finished chapter "Connecting The Server and Database with Prisma Client" & started the following "Realtime GraphQL Subscriptions"
In this new chapter, context is defined like this:
const server = new ApolloServer({
typeDefs: fs.readFileSync(
path.join(__dirname, 'schema.graphql'),
'utf8'
),
resolvers,
context: ({ req }) => {
return {
...req,
prisma,
pubsub
userId:
req && req.headers.authorization
? getUserId(req)
: null
};
}
});
But in the previous chapter, context was just an object which stored prisma instance.
A funny thing is that it's written Now, in the same file, add pubsub to the context, just as did with prisma:
but I didn't do like this at all with prisma.
As well, the tuto invites us to create a new file in resolver/
folder. If I can understand why a modular structure, I'm sure that this folder hasn't been created yet.
Is there a step missing ?
Metadata
Metadata
Assignees
Labels
No labels