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

Custom fetch support per call #1369

Closed
1 task done
HugeLetters opened this issue Oct 6, 2023 · 1 comment · Fixed by #1373
Closed
1 task done

Custom fetch support per call #1369

HugeLetters opened this issue Oct 6, 2023 · 1 comment · Fixed by #1373
Labels
enhancement New feature or request openapi-fetch Relevant to the openapi-fetch library PRs welcome PRs are welcome to solve this issue!

Comments

@HugeLetters
Copy link
Contributor

Description

SvelteKit provides a custom fetch function for loaders(which provide data for components) with a bunch of QoL improvements - this fetch functions are specific to each call so they can't be provided on createClient call. Would be nice to have an option to provide custom fetch function per specific openapi-fetch call.

Proposal

Extent FetchOptions type with a fetch parameter akin to ClientOptions - default to createClient specified fetch if not provided.

Checklist

@HugeLetters HugeLetters added enhancement New feature or request PRs welcome PRs are welcome to solve this issue! openapi-fetch Relevant to the openapi-fetch library labels Oct 6, 2023
@drwpow
Copy link
Contributor

drwpow commented Oct 6, 2023

I’m open to this, and I think this should be relatively straightforward to implement—maybe just add the same fetch option to FetchOptions as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request openapi-fetch Relevant to the openapi-fetch library PRs welcome PRs are welcome to solve this issue!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants