\r\n\t\t\t\u003C/QueryClientProvider>\r\n\t\t\u003C/trpc.Provider>\r\n\t\u003C/React.StrictMode>,\r\n\tdocument.getElementById('root')\r\n)\r\n```\r\n\r\nAnd this is how I am using the hooks inside the\r\n```tsx\r\nconst AppHeader: React.FC = () => {\r\n\tconst { data: school, isLoading } = trpc.useQuery([\r\n\t\t'school.get',\r\n\t\t{ id: schoolId }, //schoolId is a bigint here\r\n\t])\r\n\r\n\treturn \u003C>\u003C/>\r\n}\r\n```\r\nAnd i'm getting this error `Uncaught TypeError: BigInt value can't be serialized in JSON` which shouldn't happen if the transformer was being called. \r\n",[],1979,"react hooks not using data transformer","2022-06-13T23:17:22Z","https://github.com/trpc/trpc/issues/1979",0.71695703,{"description":3102,"labels":3103,"number":3113,"owner":3020,"repository":3020,"state":3047,"title":3114,"updated_at":3115,"url":3116,"score":3117},"### Describe the feature you'd like to request\r\n\r\n[io-ts](https://github.com/gcanti/io-ts) is a decoding/encoding library based on [fp-ts](https://github.com/gcanti/fp-ts) functional programming patterns.\r\n\r\nCurrently, the behaviour when using it with tRPC is a bit weird, it just doesn't work as it should, I believe it can be improved since I've seen a few issues already about this topic.\r\n\r\nIts syntax is very similar to `Zod` but validators returns an `Either\u003CError, Data>`.\r\n\r\n### Describe the solution you'd like to see\r\n\r\nCurrently. When using io-ts as a validator, it works like this.\r\n\r\n```ts\r\nimport * as t from \"io-ts\";\r\nimport * as E from \"fp-ts/Either\";\r\nimport { pipe } from \"fp-ts/function\";\r\n\r\nconst exampleCodec = t.type({\r\n text: t.union([t.string, t.null]),\r\n});\r\n\r\nexport const exampleRouter = router({\r\n hello: publicProcedure.input(exampleCodec.decode).query(({ input }) =>\r\n pipe(\r\n input,\r\n E.fold(\r\n (error) => {\r\n console.log(error);\r\n },\r\n (response) => {\r\n return { greeting: `Hello ${response.text ?? \"world\"}` };\r\n }\r\n )\r\n )\r\n ),\r\n});\r\n\r\n```\r\n\r\nHere, we can see we pass the `decode` function to the input of the procedure and makes the `input` type `E.Left\u003Ct.Errors> | E.Right\u003C{text: string | null}>`.\r\nNo problems here. This is 100% expected. Some minor improvements could be that if its an `E.Left` case, it fallback to a TRPC error.\r\n\r\nThe big issue comes when I want to use `useQuery()` on this procedure. Because the input it asks for is an `Either`. I would like to be able to pass the structure of the `E.Right` case. I can access that structure dynamically using `t.TypeOf\u003Ctypeof exampleCodec>`\r\n\r\n### Describe alternate solutions\r\n\r\nIf it seems too much effort, not do it.\r\n\r\n### Additional information\r\n\r\n_No response_\r\n\r\n### 👨👧👦 Contributing\r\n\r\n- [X] 🙋♂️ Yes, I'd be down to file a PR implementing this feature!",[3104,3107,3110],{"name":3105,"color":3106},"@trpc/server","9BE78E",{"name":3108,"color":3109},"💸 Get paid!","c2e0c6",{"name":3111,"color":3112},"✅ accepted-PRs-welcome","0052cc",3306,"feat: first class support for io-ts validators","2023-06-08T00:05:38Z","https://github.com/trpc/trpc/issues/3306",0.71824884,["Reactive",3119],{},["Set"],["ShallowReactive",3122],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$ftAjmtCJ7QUd0KAVk2OCxYEbVN3V8fywwSGM2-hRAsfM":-1},"/trpc/trpc/1495"]