Mon*_*key 2 react-apollo apollo-client
所以我使用 apollo 客户端添加到一个带有突变的对象列表中。假设我有一个事件,我正在添加参与者,并且我正在使用 refetchQueries 在详细信息屏幕上与参与者一起获取刷新的事件。不幸的是,data.loading == true
在这次重新获取期间我没有得到状态,这使得用户很可能会反复点击加入参与者按钮。
<Button styleName="dark full-width" onPress={()=> {
this.props.joinEvent({
variables: { eventId: Event.id, userId: user.id },
refetchQueries: ['getEvent'],
});
// how do I trigger the data.loading = true like it does during the initial fetch?
}
}>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2795 次 |
最近记录: |