Open svengau opened 1 year ago
trpc middleware allows extending the context, in particular Context Extension.
See https://trpc.io/docs/server/middlewares#context-extension
To reproduce, simply;
isAuthenticated
findManyUser
ctx.user
In findManyUser, ctx.user should be typed as a string
ps: Thanks for this awesome job, I come from the graphql world, and really appreciated the graphql-shield.
graphql-shield
Bug report
Describe the bug
trpc middleware allows extending the context, in particular Context Extension.
See https://trpc.io/docs/server/middlewares#context-extension
To Reproduce
To reproduce, simply;
isAuthenticated
rule to the official example,findManyUser
).findManyUser
, checkctx.user
. It's still null.Expected behavior
In
findManyUser
,ctx.user
should be typed as a stringps: Thanks for this awesome job, I come from the graphql world, and really appreciated the
graphql-shield
.