Skip to content

Commit

Permalink
docs(graphql): Add warning to always use Resolver(() => DTOClass)
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-martin committed Mar 17, 2021
1 parent ab6ddca commit ca7b713
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions documentation/docs/graphql/resolvers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit ca7b713

Please sign in to comment.