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

allParamsOptional wrong type for query keys #1897

Open
josippapez opened this issue Feb 13, 2025 · 0 comments
Open

allParamsOptional wrong type for query keys #1897

josippapez opened this issue Feb 13, 2025 · 0 comments
Labels
tanstack-query TanStack Query related issue

Comments

@josippapez
Copy link

When setting allParamsOptional property to true the queryKey generated is using wrong type.

Example:

export const getGetEventsQueryKey = (params: GetEventsParams) => {
  return [`/v1/calendar-events`, ...(params ? [params] : [])] as const;
};

params argument should have undefined also. params?: GetEventsParams

@melloware melloware added the tanstack-query TanStack Query related issue label Feb 13, 2025
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