I am using apollo-server-express
This is how I create my server:
// index.ts
...
import { createContext } from './context'
const server = new ApolloServer({
schema,
context: createContext,
})
...
// context.ts
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient()
export interface Context {
prisma: PrismaClient
}
export function createContext(req: any): Context {
// How to get acces to `res` because I need to set a refreshToken in the cookie via res.cookie(...)
return { ...req, prisma }
}
How can I access to res
, because I need to update the refreshToken in a http Only cookie