diff --git a/sample/31-graphql-federation-code-first/posts-application/src/posts/posts.resolver.ts b/sample/31-graphql-federation-code-first/posts-application/src/posts/posts.resolver.ts index 891f1398aac..c66f8dc38a0 100644 --- a/sample/31-graphql-federation-code-first/posts-application/src/posts/posts.resolver.ts +++ b/sample/31-graphql-federation-code-first/posts-application/src/posts/posts.resolver.ts @@ -9,13 +9,14 @@ import { import { Post } from './models/post.model'; import { User } from './models/user.model'; import { PostsService } from './posts.service'; +import { ParseIntPipe } from '@nestjs/common'; @Resolver((of) => Post) export class PostsResolver { constructor(private readonly postsService: PostsService) {} @Query((returns) => Post) - post(@Args({ name: 'id', type: () => ID }) id: number): Post { + post(@Args({ name: 'id', type: () => ID }, ParseIntPipe) id: number): Post { return this.postsService.findOne(id); }