@kamilmysliwiec, @MichalLytek I think this issue is similar to #368
[ ] 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.
Decorators @Resolver+@ResolveProperty don't work together on single method.
[Nest] 19238 - 09/09/2019, 6:45:53 PM [NestFactory] Starting Nest application...
[Nest] 19238 - 09/09/2019, 6:45:53 PM [InstanceLoader] ApplicationModule dependencies initialized +39ms
[Nest] 19238 - 09/09/2019, 6:45:53 PM [InstanceLoader] RecipesModule dependencies initialized +1ms
[Nest] 19238 - 09/09/2019, 6:45:53 PM [InstanceLoader] GraphQLModule dependencies initialized +1ms
(node:19238) UnhandledPromiseRejectionWarning: Error: Book.Book defined in resolvers, but not in schema
(node:19238) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:19238) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I expect to application at the example will start.
https://github.com/galkin/nest-graphql-bug-report/blob/master/src/recipes/recipes.resolver.ts#L49
Nest version: 6.6.7
For Tooling issues:
- Node version: v10.16.3
- Platform: Mac
Shouldn't @Resolver(of => Book) be placed above RecipesResolver class? 馃槙
@MichalLytek, I want to have several different types at one class. For example:
@Resolver(of => Book)
@ResolveProperty('recipes', () => [Recipe])
async recipesAtBook(@Root() book: Book): Promise<Recipe[]> {
return this.recipesService.findAll({ skip: 0, take: book.pageCount });
}
@Resolver(of => Post)
@ResolveProperty('recipe', () => Recipe)
async recipesAtBook(@Root() post: post): Promise<Recipe> {
return this.recipesService.findAll({ skip: 0, take: post.recipeCount });
}
If it is blocked on type-graphql, then I can remake example with bug report.
I want to have several different types at one class
Tracked by: https://github.com/MichalLytek/type-graphql/issues/193
Not possible by now 馃槥
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
Tracked by: https://github.com/MichalLytek/type-graphql/issues/193
Not possible by now 馃槥