Skip to content

Commit

Permalink
feat: Retain original Request in local context as meshRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
aarne committed May 21, 2024
1 parent ab117d5 commit 4d193c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ function wrapLocal(fetchFn: FetchFn) {
const wrapped = async (
url: string,
options?: MeshFetchRequestInit | undefined,
context?: { request?: Request },
context?: { request?: Request; meshRequest?: Request },
info?: GraphQLResolveInfo | undefined
) => {
const headers = options?.headers ?? {};
if (context?.request) {
context.request.headers.forEach((value, key) => {
headers[key] = value;
});

context.meshRequest = context.request;
}

return fetchFn(
Expand Down

0 comments on commit 4d193c6

Please sign in to comment.