突变中的更新方法不是 运行

Update method in mutation not running

我有以下组件可以改变数据。 Apollo 提供了自动更新商店的功能。我想使用 update 函数控制数据添加到商店的方式。该文档非常简单,但我无法正常工作。下面的代码有什么问题会阻止 console.log 打印。

import React from 'react'
import { connect } from 'react-redux';
import { graphql, gql, compose } from 'react-apollo';
import { personCodeSelector } from '../../selectors/auth';
import UploadBankStatement from '../../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);

请注意,我发现了一些类似的 ,但似乎并没有说明我的情况。

服务器重启解决了我的问题。不确定为什么热重装需要这样做。代码正确。