generated from apollographql/typescript-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
I have a requirement to set cookies and response headers for my Azure/Apollo 4 GraphQL API.
Example resolver setting a cookie and a custom response header.
import type { Context } from "@azure/functions";
const resolvers = {
Query: {
hello: (_: unknown, args: unknown, context: Context): String => {
const myCookie = cookie.serialize("my-cookie", `test-${Math.random()}`, {
maxAge: 86400,
httpOnly: true,
sameSite: "none",
secure: false,
});
context?.res?.headers["Set-Cookie"] = myCookie;
context?.res?.headers["x-correlation-id"] = "1234";
return "hello";
},
},
};
However, this will currently not work since apollo-server-integration-azure-functions
ignores context.res?.headers
when serving the API response to the Azure Function.
However this change makes it work:
Is this an oversight or am I using the library incorrectly?
Metadata
Metadata
Assignees
Labels
No labels