Skip to content
Discussion options

You must be logged in to vote

Hi @chrisLovesCode,

A middleware function has the following signature:

type SdkFunctionWrapper = <T>(action: (requestHeaders?:Record<string, string>) => Promise<T>, operationName: string, operationType?: string) => Promise<T>;

meaning that you can pass new headers to the current request, and, I guess, get the returned headers from the result of the request (return of action()).
I am not an expert with this plugin, but you might need to use rawRequest() instead of simple request() in order to get the response headers.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@chrisLovesCode
Comment options

@charlypoly
Comment options

Answer selected by charlypoly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants