Fetch api.orders.getAll with these arguments a,b,c \r\n\r\n```\r\ncomments: \r\n- I left out the comments as I don't know how to document it right, so here are some comments. \r\n- is use proxies to solve the missing key errors. \r\n- Functions are needed making it possible to be `api.orders` and `api.orders()`. \r\n- _path saves the path like `api.orders.getAll`\r\n- When somewhere a function is called, handlers.apply is called. \r\n- this is *an* implementation not *the* implementation, rather a proof of concept. I use the proxy syntax never, but vue's reactivity system uses it.\r\n\r\n## Final notes\r\nI trying my best to make it easy to grasp, Try the code provided in technical details in your own sandbox to understand a little bit better how it works. Personally, I think this is the easiest syntax as it feels like your calling a function on your backend. I also understand this not Graphql like syntax. Potentially you can have multiple client interfaces. To be honest, I only know this library for a couple of days, because Theo appeared in my youtube feed. So I also don't know if this syntax is in line with the vision of trpc. \r\n\r\nAfter all, I still wanted to show this javascript trickery and proposal, especially after the many hours figuring it out. Do not hesitate to ask further questions if something is unclear. \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n",[2948],{"name":2949,"color":2950},"💡 ideas","bfdadc",2215,"Documentation Proxy Api and @trcp/client","2022-10-04T06:09:12Z","https://github.com/trpc/trpc/issues/2215",0.6650191,{"description":2957,"labels":2958,"number":2959,"owner":2868,"repository":2868,"state":2881,"title":2960,"updated_at":2961,"url":2962,"score":2963},"(This is a follow-up to [this Discord thread](https://discord.com/channels/867764511159091230/894984069291581511/997850601100677150))\r\n\r\nI was checking out the v10 docs (https://alpha.trpc.io) and noticed a bunch of things I was massively turned off by and I'm pretty confident I'm not alone in this, I figured maybe I should provide this feedback to you guys before v10 gets released so that hopefully things improve.\r\nThe major issue for me is the new client API:\r\n\r\n## Client API:\r\n### The setup:\r\nThe new client API basically has a two-step setup:\r\n```ts\r\nimport { createTRPCClient, createTRPCClientProxy } from '@trpc/client';\r\n\r\nconst client = createTRPCClient\u003CAppRouter>({\r\n url: 'http://localhost:5000/trpc'\r\n});\r\n\r\nconst proxy = createTRPCClientProxy(client);\r\n```\r\nI'm not quite sure about the rationale behind this design but I'm pretty sure it would feel confusing, redundant, and verbose to most users. I especially dislike the fact that the variable (or constant, to be more accurate) that you will have to use over and over again to execute your procedures is called `proxy`, that's pretty vague and the word `client` would've been far better, but sadly it's taken in this context due to the two-step nature of this setup. The current workaround for this would be something like:\r\n```ts\r\nimport { createTRPCClient, createTRPCClientProxy } from '@trpc/client';\r\n\r\nconst client = createTRPCClientProxy(\r\n createTRPCClient\u003CAppRouter>({\r\n url: 'http://localhost:5000/trpc'\r\n })\r\n);\r\n```\r\nWhich is obviously verbose and ugly, so why not just:\r\n```ts\r\nimport { createClient } from '@trpc/client';\r\n\r\nconst client = createClient({\r\n url: 'http://localhost:5000/trpc'\r\n});\r\n```\r\nNotice the `createClient` function name as well. This provides two advantages:\r\n- It's shorter and more easily readable than `createTRPCClient`, I think putting the word `TRPC` in that function name is fundamentally redundant since the function is being imported from `@trpc/client` anyway. If someone has the same function name in the same scope they could simply do `import * as trpc from '@trpc/client` and then `trpc.createClient(...)`, which looks much better in my opinion. Although I understand this point could be somewhat subjective.\r\n- The more objective reason, so to speak, is that this allows you to keep the old `createTRPCClient` function for backward-compatibility, which seems to me to be the reason behind this new `createTRCPClientProxy` thing in the first place. Correct me if I'm wrong.\r\n\r\n### The usage:\r\nApparently the way you're supposed to call the procedures is like this:\r\n```ts\r\nconst bilbo = await proxy.getUser.query('id_bilbo');\r\nconst frodo = await proxy.createUser.mutation({ name: 'Frodo' });\r\n```\r\nThis one was legit painful for me to look at. At first glance, this syntax doesn't make any sense. Why not just:\r\n```ts\r\nconst bilbo = await proxy.getUser('id_bilbo');\r\nconst frodo = await proxy.createUser({ name: 'Frodo' });\r\n```\r\nIt's clear that `getUser` is a query and `createUser` is a mutation, so why the unnecessary verbosity?!\r\nTurns out the purpose of this peculiar syntax is to account for [a very specific type of scenario](https://discord.com/channels/867764511159091230/997850601100677150/997855779187077203) in which a query has an input that's too large to fit inside the character limit of URLs in a GET request, so it's instead sent as a mutation (i.e. as a POST request) so that input gets sent put in the body of that request.\r\n\r\nThis feels to me like a cheap hack to solve a specific problem for which tRPC should instead provide an explicit solution/configuration option, instead of doing something like this which apart from being extremely non-obvious, downright violates the semantics of queries and mutations, and makes the syntax nonsensical and needlessly verbose.\r\n\r\nI think it makes more sense for tRPC to provide an explicit configuration option to address this particular problem (e.g. `usePost: true`), take a look at [this](https://discord.com/channels/867764511159091230/997850601100677150/997858329567182988) and the other comments for some ideas.\r\n\r\nLet me know your thoughts.\r\nThank you.",[],2217,"v10 client API design","2022-07-20T11:19:13Z","https://github.com/trpc/trpc/issues/2217",0.6697708,["Reactive",2965],{},["Set"],["ShallowReactive",2968],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$fksPPCmVCaq8SpXPoOXWUVKMVznsbstFOGpK4VUO7xx4":-1},"/trpc/v10-playground/23"]