본문 바로가기
Backend/🐯 Nest

[Nest] TS2345: Argument of type 'TypedPropertyDescriptor<'somthing'>' is not assignable to parameter of type 'number'

by 파크park 2021. 8. 25.
  • TS2345: Argument of type 'TypedPropertyDescriptor<() => Podcast[]>' is not assignable to parameter of type 'number'
    • GraphQL Query 를 작성할 때, @nestjs/common 이 아닌 @nestjs/graphql 에서 import 되어야 한다. 자동으로 common 에서 import 되는 경우가 많으니 주의하도록 하자.
import { Query } from '@nestjs/common';
import { Resolver } from '@nestjs/graphql';
import { Podcast } from './entities/podcast.entity';
import { PodcastsService } from './podcasts.service';

-> 

import { Resolver, Query } from '@nestjs/graphql';
import { Podcast } from './entities/podcast.entity';
import { PodcastsService } from './podcasts.service';