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

__resolveType is included in enhancers by default #1468

Closed
timhall opened this issue Apr 1, 2021 · 2 comments
Closed

__resolveType is included in enhancers by default #1468

timhall opened this issue Apr 1, 2021 · 2 comments

Comments

@timhall
Copy link
Contributor

timhall commented Apr 1, 2021

I'm submitting a...


[x] Regression 
[ ] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

__resolveType is included in enhancers by default. Additionally, the ExecutionContext that's passed to guards for __resolveType has incorrect GraphQL args, with info in the slot where context should be, so the methods on GqlExecutionContext return incorrect values.

Expected behavior

Only Queries and Mutations should be included in enhancers by default.

Minimal reproduction of the problem with instructions

https://github.com/timhall/nestjs-resolvetype-issue

Issue was introduced in da4f751 where __resolveType used to be covered by the below, but now flows through to the defaults in ExternalContextCreator, which has enhancers enabled by default.

Old default:

{
  guards: fieldResolverEnhancers.includes('guards'),
  filters: fieldResolverEnhancers.includes('filters'),
  interceptors: fieldResolverEnhancers.includes('interceptors'),
}

New default:

https://github.com/nestjs/nest/blob/097afb0884415ee98910d93380b3eb6592cfb03c/packages/core/helpers/external-context-creator.ts#L101

What is the motivation / use case for changing the behavior?

Match previous behavior

Environment


Nest version: 7.6.15
NestJS GraphQA version: 7.10.3
 
For Tooling issues:
- Node version: 12
- Platform:  Mac
@michaelbromley
Copy link

michaelbromley commented May 27, 2021

I'm running into the same issue I think, which I describe in detail here: #1364 (comment)

I would love to see this fix merged and released, as then I can get all my transitive graphql dependencies updated - as you might know, multiple versions of graphql in the dependency tree can lead to tricky problems - right now I need to keep my project Vendure pinned to v7.9.7, which means that it does not work with npm v7 since npm v7 by default installs all peerDependencies, as it results in a Cannot use GraphQLSchema "..." from another module or realm error.

@kamilmysliwiec
Copy link
Member

Let's track this here #1469

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

3 participants