Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: TRPC middleware #46

Open
levi opened this issue Sep 5, 2023 · 3 comments
Open

Feature request: TRPC middleware #46

levi opened this issue Sep 5, 2023 · 3 comments

Comments

@levi
Copy link

levi commented Sep 5, 2023

I've hacked together a TRPC middleware for my v1 integration, but it seems to be broken with v2. Still debugging the issue, but would love to have an officially managed middleware I can use on specific TRPC endpoints.

@chronark
Copy link
Contributor

chronark commented Sep 6, 2023

I think there was a community trpc adapter, but now I can't find it anymore
I'll ask around

@kilinkis
Copy link

kilinkis commented Oct 3, 2023

Interested as well

@johnoppenheimer
Copy link

If it helps anyone, I made a gist with a working trpc middleware for QStash https://gist.github.com/johnoppenheimer/adc409f5a7aec65c4a14085a6b583038

I took inspiration from the nextjs handler and just made it more TRPC.
The main thing is the body, TRPC expect the input of a mutation using POST to be inside a json attribute, so just shove the rawBody coming from the middleware options to inside it and it works.

Open to make a PR if that's helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants