Skip to content
Discussion options

You must be logged in to vote

I propose to extend this support to allow end-users to add arbitrary values, thereby facilitating a more flexible usage of the

I would say this is exactly what meta is for 😅 . From the docs:

meta: Record<string, unknown>
Optional
If set, stores additional information on the query cache entry that can be used as needed. It will be accessible wherever the query is available, and is also part of the QueryFunctionContext provided to the queryFn.

const queryClient = new QueryClient({
  defaultOptions: {
    queries: {
      meta: {
       api // inject http client
     }
    }
  }
})

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@TkDodo
Comment options

@kj455
Comment options

@kj455
Comment options

@TkDodo
Comment options

@kj455
Comment options

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