Open vgandzyuck opened 10 months ago
Are resolves required when skipResolverArgs
is set to false?
skipResolverArgs: false
export interface IMutation {
signIn(login: string, password: string): User | Promise<User>;
signUp(): User | Promise<User>;
}
So yes they are required
Would you like to create a PR for this issue?
Would you like to create a PR for this issue?
"I will have the opportunity to delve into this only next weekend; unfortunately, I haven't had the chance to be a contributor to NestJS before."
@kamilmysliwiec I found the issue, can some just create PR according to the rules?
File: packegs/graphql/graphql-ast.explorer.ts
Method: toPropertyDeclarationStructure
Line: 317
Current code
return {
name: propertyName,
type: this.addSymbolIfRoot(type),
hasQuestionToken:
!required || (item as FieldDefinitionNode).arguments?.length > 0,
};
I think that the correct way is not to look on arguments array at all
return {
name: propertyName,
type: this.addSymbolIfRoot(type),
hasQuestionToken: !required,
};
Is there an existing issue for this?
Current behavior
For the NestJS/GraphQL module, you can configure definitions to automatically create a .d.ts file. So, if you have any resolvers in your application that accept parameters, the definition of these resolvers in the .d.ts file becomes optional.
Minimum reproduction code
https://codesandbox.io/p/sandbox/wild-architecture-jz3y27?file=%2Fschema.d.ts%3A18%2C2
Steps to reproduce
See sandbox
npm start:dev
Expected behavior
Resolvers with/within arguments are not optional in .d.ts
Package
Other package
@nestjs/graphql
NestJS version
10.2.8
Packages versions
Node.js version
20.9.0
In which operating systems have you tested?
Other
No response