0
所以我使用apollo客戶端添加了一個突變的對象列表。假設我有一個活動,並且我添加了參與者,並且我正在使用refetchQueries在參與者詳細信息屏幕上獲取刷新事件。不幸的是,我在這次重新訪問過程中沒有獲得data.loading == true
的狀態,使得用戶可能會不斷重複點擊該加入參與者按鈕。隨着apollo客戶端如何設置突變refetchQueries的加載狀態?
<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?
}
}>
另外,我剛纔注意到,當你添加的選項'notifyOnNetworkStatusChange:TRUE'了'data.loading'財產不更新上重新提取。 – Patrick