Closed yostools closed 5 years ago
Can you provide a repo to reproduce?
@nartc under the following link I have provided a repository in which the problem occurs: https://github.com/yostools/nest-example
If you run npm run test:e2e
you can see that during the tests a console.log was executed with the context in the pipe (src/common/pipes/check.pipe.ts:24
), which is unfortunately undefined:
console.log src/common/pipes/check.pipe.ts:24
Current context undefined
Does anyone have a clue for me as to whether this is possible or will soon be possible?
It seems that it's the same issue as here https://github.com/nestjs/nest/issues/1916 let's track this in a one place
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I'm submitting a...
Current behavior
The context cannot be integrated into a pipe.
Expected behavior
The context should be integrated into the pipe via @Inject.
Minimal reproduction of the problem with instructions
I want to use a pipe to change the transferred data according to the current user. How do I integrate the context into a pipe?
To create the basic structure, I followed the instructions in the documentation:
I've tried to integrate context via Injection:
And integrated the pipe into the module:
But
this.context
in thetransform
method is undefined.I am using the pipe in a GraphQL resolver:
What is the motivation/use case for changing the behavior?
I want to use a pipe to change the input data according to the current user.
Environment