\r\n \u003C/WagmiProvider>\r\n );\r\n}\r\n\r\nimport { withTRPC } from \"@trpc/next\";\r\nimport type { AppRouter } from \"@/backend/router\";\r\n//remember to add wagmi wrapper\r\n\r\nexport default withTRPC\u003CAppRouter>({\r\n config({ ctx }) {\r\n /**\r\n * If you want to use SSR, you need to use the server's full URL\r\n * @link https://trpc.io/docs/ssr\r\n */\r\n const url = process.env.VERCEL_URL\r\n ? `https://${process.env.VERCEL_URL}/api/trpc`\r\n : \"http://localhost:3000/api/trpc\";\r\n\r\n return {\r\n \r\n url,\r\n /**\r\n * @link https://react-query.tanstack.com/reference/QueryClient\r\n */\r\n // queryClientConfig: { defaultOptions: { queries: { staleTime: 60 } } },\r\n };\r\n },\r\n /**\r\n * @link https://trpc.io/docs/ssr\r\n */\r\n ssr: false,\r\n})(MyApp);\r\n```",[],1775,"I've been looking into this for over 2 hrs now. Is it possible to set custom headers after a query is successfull ?","2022-04-11T22:21:04Z","https://github.com/trpc/trpc/issues/1775",0.7187317,{"description":2913,"labels":2914,"number":2915,"owner":2853,"repository":2853,"state":2891,"title":2916,"updated_at":2917,"url":2918,"score":2919},"I'm working with implementing authentication using `trpc`. I use the `fetch` adapter. I need to set the `Set-Cookie` response header. However in trying so I discovered that `fetch`'s `Response` objects do not allow setting this header, as per the spec [here](https://fetch.spec.whatwg.org/#forbidden-response-header-name).\r\n\r\n> A forbidden response-header name is a [header name](https://fetch.spec.whatwg.org/#header-name) that is a [byte-case-insensitive](https://infra.spec.whatwg.org/#byte-case-insensitive) match for one of:\r\n>\r\n> - `Set-Cookie`\r\n> - `Set-Cookie2`\r\n\r\nAfter some debugging, I was able to come to the conclusion that the problem lies with the `res.headers.set(...)` call on line `52`. The `Headers` object's implementation silently ignores calls to this (and `.append` I think) with the `key` set to one of the above alternative from the spec.\r\n\r\nhttps://github.com/trpc/trpc/blob/2af7a0070f3bc01b81fe6f14f591e77c549520a7/packages/server/src/adapters/fetch/fetchRequestHandler.ts#L42-L59\r\n\r\nFortunately there is a potential solution in my eyes. This would be to extract the header keys and values from `result.headers` before constructing the `Response` object. Passing the new `headers` record into the `headers` option.\r\n\r\n```ts\r\nconst headers = {};\r\n\r\n// collect headers...\r\n\r\nconst res= new Response(result.body, {\r\n status: result.status,\r\n headers,\r\n});\r\n```\r\n\r\nI am a little worried this solution might cause problems considering I don't know if this approach would bypass all of `Headers` addition checks. Maybe if this is the case, only extract and inject the \"forbidden response-header names\" before constructing the `Response` object and continue using the current approach for all rest.\r\n\r\nIf this behaviour is intentional, or if you require more information please let me know.\r\n\r\nThanks.\r\n\r\n### Info\r\n\r\n- `trpc`: `10.0.0-alpha.40`",[],2312,"Cannot set `Set-Cookie` response header","2022-12-11T18:01:45Z","https://github.com/trpc/trpc/issues/2312",0.7188148,{"description":2921,"labels":2922,"number":2923,"owner":2853,"repository":2854,"state":2891,"title":2924,"updated_at":2925,"url":2926,"score":2927},"I have set up two routes in order to see how trpc-openapi generated error responses in the spec file, but I can't seem to get it to work.\r\n\r\nHere is the resulting spec:\r\n```yaml\r\n/error/bad-request:\r\n get:\r\n operationId: query.error.badRequest\r\n parameters: []\r\n responses:\r\n '200':\r\n description: Successful response\r\n content:\r\n application/json:\r\n schema: {}\r\n default:\r\n $ref: '#/components/responses/error'\r\n /error/too-many-requests:\r\n get:\r\n operationId: query.error.tooManyRequests\r\n parameters: []\r\n responses:\r\n '200':\r\n description: Successful response\r\n content:\r\n application/json:\r\n schema: {}\r\n default:\r\n $ref: '#/components/responses/error'\r\n```\r\n\r\nAnd here is the TypeScript definition:\r\n\r\n```ts\r\nimport { z } from \"zod\";\r\n\r\nimport { createTRPCRouter, publicProcedure } from \"../trpc\";\r\nimport { TRPCError } from \"@trpc/server\";\r\n\r\nexport const errorRouter = createTRPCRouter({\r\n badRequest: publicProcedure\r\n .meta({\r\n openapi: {\r\n method: \"GET\",\r\n path: \"/error/bad-request\",\r\n },\r\n })\r\n .input(z.void())\r\n .output(z.void())\r\n .query(() => {\r\n throw new TRPCError({\r\n code: \"BAD_REQUEST\",\r\n message: \"Bad request\",\r\n });\r\n }),\r\n tooManyRequests: publicProcedure\r\n .meta({\r\n openapi: {\r\n method: \"GET\",\r\n path: \"/error/too-many-requests\",\r\n },\r\n })\r\n .input(z.void())\r\n .output(z.void())\r\n .query(() => {\r\n throw new TRPCError({\r\n code: \"TOO_MANY_REQUESTS\",\r\n message: \"Too many requests\",\r\n });\r\n }),\r\n});\r\n```\r\n\r\nUsing cURL on the REST endpoints, I can see that the proper response codes are returned, but I don't understand why that doesn't show up in the spec. Is that intended behaviour, or do I need to do something different?",[],258,"Next.js adapter doesn't generate error status codes in openapi.json","2023-03-03T11:02:30Z","https://github.com/trpc/trpc-openapi/issues/258",0.7371079,{"description":2929,"labels":2930,"number":2934,"owner":2853,"repository":2853,"state":2891,"title":2935,"updated_at":2936,"url":2937,"score":2938},"Would be possible for each query/mut to have a `schema:`-prop next to the resolver where one could define an api schema of which the structure could be statically enforced as well.\n\nMaybe the input arg of the schema could also be used as an actual input validator?\n\n\n---\n\nAnother way could possibly be to statically infer the swagger schema with codegen, but then one couldn't actually _document_ properties. ",[2931],{"name":2932,"color":2933},"@trpc/server","9BE78E",164,"[RFC] OpenAPI aka swagger support ","2021-04-12T21:58:25Z","https://github.com/trpc/trpc/issues/164",0.74343175,["Reactive",2940],{},["Set"],["ShallowReactive",2943],{"$fTRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"$f6CtI6EyxcJx8ujkPulcoX0_I0DJpTgjnUdHVa8x4ftE":-1},"/trpc/trpc-openapi/333"]