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

fix(query): vue-query generates undefined function "useCallback" #1902

Merged
merged 1 commit into from
Apr 4, 2025

Conversation

wiz-tajima
Copy link
Contributor

@wiz-tajima wiz-tajima commented Feb 16, 2025

Status

READY

Description

Fix #1872

Related PRs

List related PRs against other branches:

branch PR
N/A N/A

Todos

  • Tests
  • Documentation
  • Changelog Entry (unreleased)

※ I did tests with husky and generating samples made from my project

Steps to Test or Reproduce

  1. make files to set override: mutator, formData and query.
  2. make orval.config.ts with property below:
client: 'vue-query',
override: {
          mutator: {
            path: "./mutator/use-custom-instance.ts",
            name: "useCustomInstance",
          },
          formData: {
            path: "./mutator/custom-form-data.ts",
            name: "customFormData",
          },
          query: {
            queryOptions: {
              path: "./mutator/custom-query-options.ts",
              name: "customQueryOptions",
            },
}
  1. generate.
    Before fix, it will generate file using method "useCallback" on all client.
    After fix, it will generate file without useCallback on vue-query client while the other clients will execute as before.

Sorry, something went wrong.

@melloware
Copy link
Collaborator

LGTM but i would like @anymaniax to review this one.

@anymaniax
Copy link
Collaborator

We have the same issue for svelte so would be good to only add the useCallback for react. Would be ok to do that instead?

@melloware
Copy link
Collaborator

Where are we with this PR @wiz-tajima ?

@wiz-tajima
Copy link
Contributor Author

wiz-tajima commented Apr 4, 2025

@melloware @anymaniax
I'm sorry to too late reply.

We have the same issue for svelte so would be good to only add the useCallback for react. Would be ok to do that instead?

I all agree to this opinion.
Is this task mine? Or, you could do it?
( I have only experience of Vue, so it seems to be good assigned someone has skill. )

@melloware melloware merged commit a154264 into orval-labs:master Apr 4, 2025
0 of 2 checks passed
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 this pull request may close these issues.

Vue Query: It generates undefined function "useCallback"
3 participants