reactjs - how to use `subscribeToMore` with `apolloClient.query()` -


i'm building react-native application , using sagas/redux. in 1 of components, i'm dispatching function fetch messages , update store (i'm not sure if practice, thoughts?)

export function* messagesearch({ filter }) {   const res = yield call(() => apolloclient.query({     query: gql`         query($filter: json) {           messages:messagesearch(filter: $filter) {             id             time             text             fromid             attachment           }         }       `,     fetchpolicy: 'network-only',     variables: {       filter     }   }))    if (res.data && res.data.messages) {     yield put(conversationactions.messagesearchsuccess(res.data.messages))   } else {     yield put(conversationactions.messagesearchfailure('wrong'))   } } 

the question how use subscribetomore pattern subscription new data without wrapping component graphql(gql'query { ... }')(mycomponent) , use data.subscribetomore


Comments

Popular posts from this blog

javascript - Create a stacked percentage column -

Optimising Firebase database by automatically overwriting data -

javascript - Angular UI-Grid customTemplate directive causing rows to load slowly/? -