【发布时间】:2018-05-15 02:38:42
【问题描述】:
我正在尝试通过 Apollo 客户端在 iOS 中使用 GraphQL。我有以下突变:
login(user: String!, password: String!): UserType
UserType 如下所示:
id: ID
user: String!
password: String!
name: String
lastname: String
email: Email!
groups: [GroupType]
在 iOS 中,我按照文档所述配置了 aopllo 客户端,并且运行良好,但我不知道如何访问响应中的每个字段。当登录成功时,我想读取我收到的 json 作为 UserType 字段的响应,所以,我正在这样做:
apolloClient.perform(mutation: loginMutation) {
resultsGQL, error in
...
}
我的问题是,如何从 resultGQL 中读取属于我的 grapql 架构中定义的 UserType 数据的每个字段?
问候
【问题讨论】:
标签: ios swift graphql apollo-client apollo-ios