nestjs autoSchemaFile에러
import { ApolloDriver, ApolloDriverAsyncConfig as ad } from '@nestjs/apollo';
import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { AppController } from './app.controller';
import { AppService } from './app.service';
@Module({
imports: [
GraphQLModule.forRoot<ad>({
// forRoot의 데이터타입지정 <> -> 제네릭 부분
driver: ApolloDriver,
autoSchemaFile: 'src/commons/graphql/schema.gql',
}),
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}

import { Field, Int, ObjectType } from '@nestjs/graphql';
@ObjectType() // graphql에서 type을 의미함 예)type Board
export class Board {
@Field(() => Int) // Int를 import를 해서 사용해야한다
number: number;
// ;을 기준으로 구분함
@Field(() => String) // graphql을 위한 용도
writer: string;
@Field(() => String)
title: string;
@Field(() => String)
contents: string;
}
단순히 graphql shema를 자동생성 해주는 거만 테스트할려고했는데 경로를 잡아주니 에러가나와서
true도 해보고 playground : true도 추가해보고했는데 계속 해서 오류가 나고 계속해서 오류는 type이 존재하지않는다고해서 이유를 모르겠습니다
Argument of type '{ driver: typeof ApolloDriver; autoSchemaFile: string; }' is not assignable to parameter of type 'ApolloDriverAsyncConfig'.
Object literal may only specify known properties, and 'autoSchemaFile' does not exist in type 'GqlModuleAsyncOptions<ApolloDriverConfig, GqlOptionsFactory<ApolloDriverConfig>>'.ts(2345)
답변 1
0
안녕하세요! Daon님!
올려주신 에러 메시지를 읽어보면 이러한 내용이 있네요!
Argument of type '{ driver: typeof ApolloDriver; autoSchemaFile: string; }' isnot assignable to parameter of type 'ApolloDriverAsyncConfig'.
천천히 한 번 쭉 읽어보시면, ApolloDriverAsyncConfig 부분이 잘못된 것 같아요!
수업때는 ApolloDriverConfig를 사용했답니다!^^
그래프 ql 문서 사용할때 느낌표 남는거 어떻게 없애나요?
0
84
2
강의 전체 소스 코드를 받고싶습니다.
0
76
2
fontawesome 사용 문의
0
79
2
소스 코드 부탁드립니다~
0
85
2
깃 레포지터리 소스
0
87
2
커리큘럼12.css 정렬 에 나오는 과제 정답알고싶어요
0
74
2
10-01 Entity TypeOrmModule.forRoot 에 entities
0
89
3
강의 버전관련 문의입니다
0
103
2
Ubuntu 설치 관련
0
61
1
schema.gql 질문 드립니다.
0
51
1
서버 재실행시 Many to Many
0
102
3
input 관련 문의
0
90
2
Rest API 보다는 graphql이 주된 내용인데
0
131
2
강의 전체 소스코드 받을수있을까요?
0
156
1
도커볼륨 마운트 관련
0
127
2
findOne 타입스크립트오류
0
109
1
http => htrtps 호출 인증서 신뢰 오류
0
354
1
self-signed certificate in certificate chain 에러 발생
0
417
1
mongoose 설치 오류
0
142
1
특정 API, 특정 IP 허용 (단일경로에 CORS 활성화)
0
283
2
08-06
0
180
3
구조랑 패턴 관련해서 질문
0
125
2
mydocker
0
128
2
coolsms statuscode 2000 인데 전송안돼는 경우 확인.
0
156
1





