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

Query options for an operation have no effect #1337

Open
C-Higgins opened this issue Apr 29, 2024 · 0 comments
Open

Query options for an operation have no effect #1337

C-Higgins opened this issue Apr 29, 2024 · 0 comments
Labels
tanstack-query TanStack Query related issue

Comments

@C-Higgins
Copy link

C-Higgins commented Apr 29, 2024

I am trying to change the react query hook options for a specific hook. Regardless of what I put into the options object, nothing changes with my output. I know this is the correct operationID, because when I change the useQuery to false, then the output does change to exclude that specific hook. It's just that the options do nothing. I have also tried using queryOptions with a mutator, but it seems to also do nothing. This is latest version.

import { defineConfig } from "orval";

export default defineConfig({
  something: {
    input: {
      target: "...",
    },
    output: {
      target: "api",
      client: "react-query",
      mode: "split",
      override: {
        useNativeEnums: false,
        mutator: {
          path: "./api/axios.ts",
          name: "orvalInstance",
        },
        operations: {
          GetApiV3User: {
            query: {
              useQuery: true,
              options: {
                staleTime: 1,
              },
            },
          },
        },
      },
    },
  },
});

For the above config, I would expect { staleTime: 1 } to be a part of the generated hook, but it is not.

@melloware melloware added the tanstack-query TanStack Query related issue label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tanstack-query TanStack Query related issue
Projects
None yet
Development

No branches or pull requests

2 participants