当我尝试运行 gradle 时,Graphql 将错误返回为“无法解析 `Array` 值,预期数组”

Posted

技术标签:

【中文标题】当我尝试运行 gradle 时,Graphql 将错误返回为“无法解析 `Array` 值,预期数组”【英文标题】:Graphql is returing the error as "Can't parse `Array` value, expected array" when I'm trying to run gradle 【发布时间】:2020-06-25 16:57:26 【问题描述】:

我正在使用 ApolloClient 在 android 中尝试突变查询,下面是我的 .graphql 文件

mutation insertAddress($city: String, $landmark: String, $postcode: Int, $state: String, $type: String, $userUuid: String) 
    __typename
    insert_addresses(objects: city: $city, landmark: $landmark, postcode: $postcode, state: $state, type: $type, userUuid: $userUuid) 
      returning 
          uuid
      
   

我收到的错误是com.sample.app\InsertAddress.graphql (3:30) Can't parse `Array` value, expected array 请帮我解决这个错误。

【问题讨论】:

【参考方案1】:

你可以试试

    mutation insertAddress($city: String, $landmark: String, $postcode: Int, $state: String, $type: String, $userUuid: String) 
    __typename
    insert_addresses(objects: [city: $city, landmark: $landmark, postcode: $postcode, state: $state, type: $type, userUuid: $userUuid]) 
      returning 
          uuid
      
   

【讨论】:

相关文档:hasura.io/docs/1.0/graphql/manual/mutations/insert.html

以上是关于当我尝试运行 gradle 时,Graphql 将错误返回为“无法解析 `Array` 值,预期数组”的主要内容,如果未能解决你的问题,请参考以下文章

当我尝试运行我的 Flutter 程序时,它会卡在“Running Gradle task 'assembleDebug”

GraphQL java后端入门[关闭]

当我的 GraphQL 架构在运行时由 postgraphile(在其自己的容器中)自动生成时,如何将中继编译器作为离线构建步骤运行?

从 eclipse+gradle 运行时 Spring Boot 错误加载测试配置

Android Studio:无法完成gradle执行,原因为空

运行gradle项目时具有未批准/未知许可证的文件