Using multiple @ArgsType()
classes combines those arguments into one object and assigns it to all parameters which are an @ArgsType
#3085
Labels
Is there an existing issue for this?
Current behavior
When using multiple parameters in a resolver (code-first), having multiple parameters which are
@ArgsType()
classes, they combine the objects together and assign the same object to all@ArgsType
parameters.Minimum reproduction code
https://github.com/NilsMoller/multiple-args-type-params-combine-minimum-repro
Steps to reproduce
nest new
npm i @nestjs/graphql @nestjs/apollo @apollo/server graphql
app.module.ts
:app.resolver.ts
class:return 'Hello World!'
and see botharg1
andarg2
to be the same object.Expected behavior
To have the arguments receive the same object structure as their class defines:
This would cause problems when both classes have the same key. In that case, I would expect to have one override the other (perhaps the last one passed), or an error to be thrown before the server starts.
Package version
^12.0.11
Graphql version
@apollo/server
:^4.9.5
@nestjs/apollo
:^12.0.11
graphql
:^16.8.1
NestJS version
^10.0.0
Node.js version
18.17.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: