Enhance meta documentation
#9946
Unanswered
thomasneger
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi TanStack team,
Delightful library. I am on the process of migrating our monorepo code base to
@tanstack/react-queryand have been absolutely loving it.I was setting up our
metaobject, in our project. We have a lot of constants that we use everywhere in our network queries and I'm very thankful to have access to thatmetaobject in all the api of the library. It might be a bit of a niche feature, but for us it's very useful.I just got really confused when the
metaobject I defined in theQueryClientdefaultOptions, was not available in theuseMutationmutationFnas it does within theuseQueryqueryFn.Here is the shortest example I could put together which illustrates my confusion:
I was actually about to create an issue for this, until, by poking around, I realized that the
QueryClientconfig is split and I have to passmetato both thequeriesandmutationsconfigs :The documentation around
metaI could find is mostly about typing, which if you read between the lines, kind of shows that meta has to be typed in 2 places.Maybe an extra documentation page on how to setup meta in general could help. If you have been using TanStack Query for a while you would probably know about this. But for me who is completely new and didn't yet have a use case to configure the mutations settings, it was not obvious at all 😄.
Thanks for reading. Keep on keeping on.
Beta Was this translation helpful? Give feedback.
All reactions