【发布时间】:2018-05-27 16:50:59
【问题描述】:
假设我从我的 props 中的查询中得到一个 user 对象。如何让type User 的所有对象具有某些方法,例如.isAdmin()?
isAdmin() {
return this.groups.contains('admin');
}
我知道我可以将isAdmin 添加为架构字段,并在服务器上为其解析器,但我不想向服务器添加负载并为响应正文添加大小。
【问题讨论】:
标签: apollo react-apollo apollo-client