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

feat(swr): support for using fetch for http clients with swr #1498

Conversation

soartec-lab
Copy link
Member

Status

READY

Description

follow up #1387
I added output.httpClient option.
And able to using fetch API with swr client. custom mutators also available.
Since @orval/fetch doesn't have a any deps, i specified @orval/fetch as a dependency of @orval/swr. This allows the automatically generated functions of the http client to be shared, improving maintainability.

Related PRs

none

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

Steps to Test or Reproduce

You can check generated code in the test

cd tests
yarn generate

I added test case is bellow:

  • generated/swr/http-client-fetch
  • generated/swr/http-client-fetch

@soartec-lab soartec-lab added the enhancement New feature or request label Jul 3, 2024
@soartec-lab soartec-lab linked an issue Jul 3, 2024 that may be closed by this pull request
7 tasks
@soartec-lab soartec-lab merged commit 3d493a7 into orval-labs:master Jul 3, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support fetch client
2 participants