Skip to content

Pass response to context #9

@nephix

Description

@nephix

Is there currently a way to pass the Response into the current context from Bun/Elysia?

I'm migrating from Node + fastify and this was possible as outlined here

With the context signature in elysia-graphql-yoga this doesn't seem possible or is there a different way?

Context extends
	| undefined
	| MaybePromise<Record<string, unknown>>
	| ((initialContext: YogaInitialContext) => MaybePromise<unknown>),

I currently use it like:

import { context } from "./myCustomContext";

elysia
    .use(
        yoga({ schema, context }),
    )
    .listen(port);

My use case is that I want to set or unset an HttpOnly cookie in a GraphQL resolver

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions