Skip to content
Discussion options

You must be logged in to vote

@synasapmob this is a known operator precedence bug in the codegen plugin. when your query has optional variables, the generated infinite query hook produces:

queryKey: optionsQueryKey ?? variables === undefined ? ['Query.infinite'] : ['Query.infinite', variables]

due to JS precedence, this parses as (optionsQueryKey ?? (variables === undefined)) ? [...] : [...] instead of optionsQueryKey ?? (variables === undefined ? [...] : [...]). your custom queryKey gets swallowed because the ?? resolves to a truthy value before the ternary evaluates.

regular queries aren't affected because they use a different codegen path that doesn't destructure queryKey from options. queryKeyHashFn still works be…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@synasapmob
Comment options

Answer selected by synasapmob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants