openapi-typescript
openapi-typescript copied to clipboard
Change defaults in fetch options
Description
Is there a way to change the default value when creating fetch client especially the baseUrl?
const client = createFetchClient({ baseUrl: 'some-url' })
for example, in axios, we can just do axiosInstance.defaults.baseURL = 'new-base-url'
Proposal
maybe
const client = createFetchClient({ baseUrl: 'some-url' })
client.defaults.baseUrl = "new-base-url"
Extra
- [ ] I’m willing to open a PR (see CONTRIBUTING.md)
one way I found is to recreate the entire fetch client with a different baseUrl