在服务器fromGlobalId(id)
上用于从中继全局 Id 到对象上的实际 Id。
目前我在客户端上做同样的事情,即
javascript
import { fromGlobalId } from 'graphql-relay'
fromGlobalId(accounts[0].id)
它给出了正确的结果:
Object {type: "Account", id: "0"}
但是我应该graphql-relay
在客户端上导入有没有一种方法可以做到这一点react-relay
?