[英]Type-graphql with lerna --- Error: Cannot determine GraphQL output type for id
[英]Parameter error with Type-GraphQL - No type for parameter?
我收到此錯誤,但不確定到底出了什么問題,因為它與我創建的其他解析器遵循相同的格式。 這是錯誤:
`Error: You need to provide explicit type for Resolver#`getMultipleSomething parameter #2
這是我的解析器:
@Resolver(() => Object)
export default class Resolver{
constructor(
private readonly service: Service
){}
@Query(() => Object)
async getSomething(@Arg('id') id : number) : Promise<Object> {
return await this.service.getSomething(id);
}
@Query(() => [Object])
async getMultipleSomething(@Arg('page') page : number, @Arg('per_page') per_page : number, @Arg('stringArray') stringArray : string[]) {
return await this.service.getSomethings(page, per_page, stringArray);
}
}
試試@Arg('stringArray', type => [string]) stringArray: string[])
參考: https://github.com/MichalLytek/type-graphql/issues/37#issuecomment-407664643
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.