graphql-mesh
graphql-mesh copied to clipboard
Pass context to fetch in json-schema loader (used in new-openapi handler)
Is your feature request related to a problem? Please describe.
In the previous open-api handler we had access to context
in our fetch function, which gave us access to a few things, for our usecase this was primarily context.request.log
which we used for logging.
Describe the solution you'd like
Passing context
to fetch
when its invoked
Describe alternatives you've considered
n/a
Additional context
Started draft PR, which functionally solves the problem, however this would require moving from the native fetch type to something more akin to the one in the openapi handler so a different approach may be preferable
customFetch
function takes context
as a third parameter. Let us know if this doesn't work.
https://github.com/Urigo/graphql-mesh/blob/master/packages/types/src/index.ts#L165