[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
When in a resolveType handler the context is wrongly resolved. Which makes me unable to use the graphql context in an global guard.
Context to be resolved correctly
https://github.com/JannesV/nestjs-issue-context
Need to use global guards
Nest version: 6.0.5
For Tooling issues:
- Node version: 8.11.4 \ 10.0
- Platform: Mac\ Linux
I also faced this problem. It's because arguments passed to resolvers by apollo-server are different on field resolvers and __resolveType.
https://www.apollographql.com/docs/graphql-tools/resolvers
But at first place, I can't understand why guard should be applied on __resolveType method. Is there any reason for this?
@kamilmysliwiec
@kamilmysliwiec if you could point me in the right direction I'll gladly submit a PR.
It should be fixed in the @next version ($ npm i @nestjs/graphql@next). You will also have to update @nestjs/core to 6.2.0 ($ npm i @nestjs/[email protected]). Please, let me know if you face any issue.
Published as 6.2.0 ($ npm i @nestjs/graphql@latest). You will also have to update @nestjs/core to 6.2.0 ($ npm i @nestjs/core@latest)
Indeed it works, thank a lot for the work you're doing!
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.
Most helpful comment
It should be fixed in the @next version (
$ npm i @nestjs/graphql@next). You will also have to update@nestjs/coreto 6.2.0 ($ npm i @nestjs/[email protected]). Please, let me know if you face any issue.