Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass context to fetch in json-schema loader (used in new-openapi handler) #4293

Closed
dr3 opened this issue Aug 11, 2022 · 2 comments
Closed

Pass context to fetch in json-schema loader (used in new-openapi handler) #4293

dr3 opened this issue Aug 11, 2022 · 2 comments

Comments

@dr3
Copy link
Contributor

dr3 commented Aug 11, 2022

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

The old openapi handler approach
The new fetch call

@dr3
Copy link
Contributor Author

dr3 commented Aug 11, 2022

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

@ardatan
Copy link
Owner

ardatan commented Mar 31, 2023

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

@ardatan ardatan closed this as completed Mar 31, 2023
@theguild-bot theguild-bot mentioned this issue Sep 28, 2023
This was referenced Apr 30, 2024
This was referenced May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants