Flutter graphql_flatter返回LazyCacheMap,用JSON字符串反序列化生成值,如何使它们一起工作
Flutter graphql_flatter返回LazyCacheMap,用JSON字符串反序列化生成值,如何使它们一起工作,flutter,graphql,Flutter,Graphql,graphql\u flatterreturnLazyCacheMap,builded\u值与JSON字符串反序列化,如何使它们协同工作 我使用graphql\u flatter来获取数据,并将结果数据作为LazyCacheMap给出 对于数据模型和数据序列化,使用builded\u值,但由于反序列化使用JSON字符串 与他们合作的最佳方式是什么 我是否应该将的LazyCacheMap的数据转换为String并调用反序列化 我应该使用其他序列化酒吧吗 首先使用dart:convert包将响应L
graphql\u flatter
returnLazyCacheMap
,builded\u值
与
JSON字符串反序列化,如何使它们协同工作
graphql\u flatter
来获取数据,并将结果数据作为LazyCacheMap
给出builded\u值
,但由于反序列化
使用JSON字符串
- 我是否应该将的
的数据转换为LazyCacheMap
并调用String
反序列化
- 我应该使用其他序列化酒吧吗
dart:convert
包将响应LazyCacheMap
编码为JSON
,然后执行您想要的任何操作
import 'dart:convert';
GraphQLClient _client = graphQLConfiguration.clientToQuery();
QueryResult result = await _client.query(
QueryOptions(
documentNode: gql(GraphQlQueries.authenticateUser()),
)
);
print(jsonEncode(result.data));
为我工作。你是如何解决这个问题的?@GEPD,使用LazyCacheMap.data谢谢!你应该把答案写在新的帖子里