小编vje*_*eko的帖子

Graphql 查询参数字符串数组

我需要将一个字符串数组传递给我的查询,以便我可以迭代它,但我不知道该怎么做。

像这样的东西:

@Query(() => Boolean)
async fetchUrl(
    @Arg('urls') urls: string[]
): Promise<Boolean> {
 // do something

 return true
}
Run Code Online (Sandbox Code Playgroud)
Error: You need to provide explicit type for FetchResolver#fetchUrl parameter #0 !
Run Code Online (Sandbox Code Playgroud)

我真的不知道如何为字符串数组提供正确的类型

graphql typegraphql

2
推荐指数
1
解决办法
4077
查看次数

标签 统计

graphql ×1

typegraphql ×1