-
Notifications
You must be signed in to change notification settings - Fork 396
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
definitions with option skipResolverArgs: true makes resolvers optional in d.ts #3065
Comments
Are resolves required when |
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? |
"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: 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
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
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
The text was updated successfully, but these errors were encountered: