tRPCttRPC
Powered by
kstulgysK
tRPC•3y ago•
9 replies
kstulgys

Why webhooks does not work with TRPC?

I have a what suppose to be a webhook:

  deposit: publicProcedure.input(z.any()).mutation(async ({ ctx, input }) => {
    console.log(input);
    return { input };
  }),
  deposit: publicProcedure.input(z.any()).mutation(async ({ ctx, input }) => {
    console.log(input);
    return { input };
  }),


When I POST to this endpoint it responds with:

{
  "result": {
    "data": {
      "json": {
        "input": null
      },
      "meta": {
        "values": {
          "input": [
            "undefined"
          ]
        }
      }
    }
  }
}
{
  "result": {
    "data": {
      "json": {
        "input": null
      },
      "meta": {
        "values": {
          "input": [
            "undefined"
          ]
        }
      }
    }
  }
}


Why?
console logs undefined on the server.
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How does tRPC work?
aspizuAaspizu / ❓-help
2y ago
How does trpc typing work
Mohammed AnasMMohammed Anas / ❓-help
3y ago
trpc openapi does not work on app router
fahadFfahad / ❓-help
3y ago