【发布时间】:2018-07-12 15:10:20
【问题描述】:
代码是这样的。我在关注apollo-link-state 示例。
const defaultState = {
"appStateOfUI": {
__typename: "appStateOfUI",
first: "John",
last: "Doe"
}
};
我们使用这些默认值来预热客户端,如下所示:
const stateLink = withClientState({
cache,
defaults: defaultState,
resolvers: {
Mutation: {
updateAppState: ...
}
}
});
并像这样初始化我的客户端。
const client = new ApolloClient({
link: ApolloLink.from([
stateLink,
new HttpLink({...})
]),
cache
});
一切正常。但不明白为什么我的不工作。
花了一段时间后,我发现一些实用程序从库端损坏,人们建议回滚。在其他thread 中进行黑客/修复。只是想在这里分享,以便其他人受益。
【问题讨论】:
标签: graphql-js react-apollo apollo-client