UNPKG

chimp

Version:

Your development companion for doing quality, faster.

20 lines (16 loc) 396 B
import { RootInterface } from "./root"; export type GqlContext = RootInterface & { req: RequestType }; type RequestType = { headers: { [key: string]: string | string[] | undefined; }; jwt?: string; }; export const appContext = (root: RootInterface) => async ({ req }: { req: RequestType }): Promise<GqlContext> => { return { ...root, req, }; };