【发布时间】:2019-07-25 09:56:52
【问题描述】:
如果架构中没有对象映射,Apollo iOS Swift 不会将 JSONArray 转换为 String。 我有一个查询,其中对象的结果数组未映射到 schema.json 架构中的描述:
{"name":"stack",
"description":"",
"args":[
],
"type":{
"kind":"LIST",
"name":null,
"ofType":{
"kind":"SCALAR",
"name":"JSON",
"ofType":null
}}}
接收到的数据如下所示:
"stack":[{
"name":"React",
"version":"",
"category":[ "JavaScript Frameworks"]}]
我收到的错误信息是
[Apollo.GraphQLResultError(path: ["userHost", "stack"], underlying: Apollo.JSONDecodingError.couldNotConvert(value: {
category = (
React
);
name = "JavaScript Frameworks";
version = "";
}, to: Swift.String))]
【问题讨论】: