TanStackT
TanStackโ€ข3y agoโ€ข
14 replies
full-green

[v5 - TypeScript]: ensure meta object type

Hi,

just updated to v5 - great ๐Ÿ™‚

Is there a way to use typescript to make sure that when I define
meta
on one of my queries it always matches the same structure?

I want to make sure that I don't typo or something in a usecase like this

meta: {
      errorTitle: t('error.title'),
      errorBody: t('error.body'),
    },


vs.

meta: {
      errorTilte: t('error.title'), // <-- typo
      errorBody: t('error.body'),
    },
Was this page helpful?