Joe
01/03/2021, 7:09 PMconst server = new ApolloServer({
gateway,
subscriptions: false,
context: ({ req }) => {
const user = req.user || null;
console.log("Prisma: " + prisma);
return { prisma, user };
}
})
Resolver:
<session request returning user>
console.log("Resolver: " + context.prisma);
context.prisma.account.create({
data: {
email: email,
password: password
},
});
Output:
Prisma: [object NewPrismaClient]
Resolver: undefined
If I stringify the context, I get:
Resolver: {"user":null,"_extensionStack":{"extensions":[]},"_shield":{"cache":{}}}
the prisma context object is always undefined in the resolver, what I am not understanding here?Ryan
01/04/2021, 7:57 AMnode_modules
and reinstalling again to see if it works?Joe
01/04/2021, 1:34 PMJoe
01/04/2021, 1:35 PM