Response headers

Is it possible to modify the response headers from server to client?
UU
Unknown User574d ago
P
peterp574d ago
🤔 I can see how I have access to req/ response in the context, but does the client have access to those things? As an example:
export async function createContext(
opts?: trpcExpress.CreateExpressContextOptions
) {
opts.res.setHeader('x', 'dog')
}
export async function createContext(
opts?: trpcExpress.CreateExpressContextOptions
) {
opts.res.setHeader('x', 'dog')
}
UU
Unknown User574d ago
P
peterp574d ago
I'm building a CLI and need to push information down to the client that isn't part of the query or mutation. I need it in each response, regardless of the context of the request.
UU
Unknown User574d ago
P
peterp574d ago
👀 aaah, cool I'm not using batching, but maybe I can just wrap fetch or create a custom httpLink I'll play around with modifying the fetch implementation passed to "createTRPCClient" Thanks! I'll report back Btw SpaceDrive looks dope af
UU
Unknown User574d ago
P
peterp574d ago
I can imagine! I see we share investors ;P I guess everyone does
UU
Unknown User574d ago
P
peterp574d ago
Abstracting the fetch property in createTRPCClient worked like a charm. Thanks for the help!