From ca7b7131e8c6a31a7609d818d95aacf2e771d449 Mon Sep 17 00:00:00 2001 From: doug-martin Date: Tue, 16 Mar 2021 22:37:05 -0600 Subject: [PATCH] docs(graphql): Add warning to always use Resolver(() => DTOClass) --- documentation/docs/graphql/resolvers.mdx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/documentation/docs/graphql/resolvers.mdx b/documentation/docs/graphql/resolvers.mdx index 354841c3b..4208b8c97 100644 --- a/documentation/docs/graphql/resolvers.mdx +++ b/documentation/docs/graphql/resolvers.mdx @@ -105,6 +105,14 @@ your class with `@Resolver`. DTO/Entity. ::: +:::warning +When using the `@Resolver` decorator from `@nestjs/graphql` you must use the following +```ts +@Resolver(() => DTOClass) +``` +otherwise relations will not work. +::: + ```ts title="todo-item.resolver.ts" import { QueryService, InjectQueryService } from '@nestjs-query/core'; import { CRUDResolver } from '@nestjs-query/query-graphql';