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

Incorrect type declaration for QueryOptions in the TanStack Query request function. #9470

Closed
UdaySagar-Git opened this issue Dec 17, 2024 · 1 comment · Fixed by #9463
Closed
Assignees

Comments

@UdaySagar-Git
Copy link
Contributor

Describe the bug

export interface QueryOptions<TBody = unknown> {
pathParams?: Record<string, string>;
queryParams?: Record<string, string>;
body?: TBody;
silent?: boolean;
signal?: AbortSignal;
headers?: HeadersInit;
}

ideally queryParams type shouldn't be restricted to the values of string

Expected behavior
It should be of type string | number | boolean | null | undefined, which is already declared as QueryParamValue in the same page

export interface QueryOptions<TBody = unknown> {
  pathParams?: Record<string, string>;
  queryParams?: QueryParams;
  body?: TBody;
  silent?: boolean;
  signal?: AbortSignal;
  headers?: HeadersInit;
}

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@rithviknishad
Copy link
Member

Completed in #9463

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants