Replies: 1 comment 1 reply
-
For static arguments, you can wrap that into function: export function CreateMyMiddleware(args: uknown[]) {
return class MyMiddleware {
// use args here
}
} and then provide the param: @UseMiddleware(CreateMyMiddleware({ foo: "bar" }) If the argument is defined in runtime, you should attach it to the graphql context. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a custom class-based middleware. The question is how I can pass a custom argument to my middleware?
Beta Was this translation helpful? Give feedback.
All reactions