caching - Update method in mutation not running -


i have following component mutates data. apollo provides functionality update store automatically. control way data added store using update function. documentation straightforward enough, can't working. wrong in code below prevent console.log printing.

import react 'react' import { connect } 'react-redux'; import { graphql, gql, compose } 'react-apollo'; import { personcodeselector } '../../selectors/auth'; import uploadbankstatement '../../components/eftfileuploads/uploadbankstatement.jsx';  const createeftfileupload = gql`mutation createeftfileupload(   $bankaccountcode: string!,   $uploadinput: uploadinput!,   $uploadedbypersoncode: string!) {     createeftfileupload(       bankaccountcode: $bankaccountcode,       uploadinput: $uploadinput,       uploadedbypersoncode: $uploadedbypersoncode) {           id           bankaccountcode           filename           numberofprocesseditems           numberofunallocateditems           createdat           status         }       }`;  const mutationconfig = {   props: ({ ownprops, mutate }) => ({     createeftfileupload: (bankaccountcode, uploadinput) => {        return mutate({         variables: {           bankaccountcode,           uploadinput,           uploadedbypersoncode: ownprops.personcode         },         update: (store, something) => {           console.log("ping");           console.log(store, something);           },       });     }   }) };  const mapstatetoprops = state => {   return {     personcode: personcodeselector(state)   }; };  export default compose(   connect(mapstatetoprops),   graphql(createeftfileupload, mutationconfig) )(uploadbankstatement); 

note have found couple of similar issues, doesn't seem shed light on situation.

server restart fix issue. not sure why required hot-reloading. code correct.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -