diff --git a/packages/dev-app/src/router.ts b/packages/dev-app/src/router.ts index b7e8a8d..6f63b2f 100644 --- a/packages/dev-app/src/router.ts +++ b/packages/dev-app/src/router.ts @@ -31,6 +31,23 @@ const postsRouter = createTRPCRouter({ text: input.text, }; }), + createNestedPost: procedure + .input( + z.object({ + text: z.string(), + }) + ) + .input( + z.object({ + title: z.string(), + }) + ) + .mutation(({ input }) => { + return { + id: "aoisdjfoasidjfasodf", + text: input.text, + }; + }), }); export const appRouter = createTRPCRouter({ diff --git a/packages/trpc-panel/src/parse/parseProcedure.ts b/packages/trpc-panel/src/parse/parseProcedure.ts index 87748e9..2f41798 100644 --- a/packages/trpc-panel/src/parse/parseProcedure.ts +++ b/packages/trpc-panel/src/parse/parseProcedure.ts @@ -73,10 +73,11 @@ function nodeAndInputSchemaFromInputs( }), }; } + + let input = inputs[0]; if (inputs.length !== 1) { - return { parseInputResult: "failure" }; + input = inputs.reduce((acc, input) => (acc as any).merge(input), emptyZodObject); } - const input = inputs[0]; const iType = inputType(input); if (iType == "unsupported") { return { parseInputResult: "failure" };