Apollo updateQueries Not Called?
<p>I'm studying Apollo pub-sub in GitHunt-React and GitHunt-API. When I run those apps and enter a new comment, the comment is saved by the call to submit, and then the  updateQueries codeblock runs here:</p>

<pre><code>const CommentsPageWithMutations = graphql(SUBMIT_COMMENT_MUTATION, {
  props({ ownProps, mutate }) {
    console.log('in CommentsPageWithMutations');
    return {
      submit({ repoFullName, commentContent }) { &lt;==RUNS THE MUTATION
        debugger;
        return mutate({
          variables: { repoFullName, commentContent },
          optimisticResponse: {
            __typename: 'Mutation',
            submitComment: {
              __typename: 'Comment',
              id: null,
              postedBy: ownProps.currentUser,
              createdAt: +new Date,
              content: commentContent,
            },
          },
          updateQueries: {
            Comment: (prev, { mutationResult }) =&gt; {
              debugger; // &lt;== RUNS AFTER THE MUTATION IS SENT TO SERVER
              const newComment = mutationResult.data.submitComment;
              if (isDuplicateComment(newComment, prev.entry.comments)) {
                return prev;
              }
              return update(prev, {
                entry: {
                  comments: {
                    $unshift: [newComment],
                  },
                },
              });
            },
          },
        });
      },
    };
  },
})(CommentsPage);
</code></pre>

<p>I have duplicated this code to my app. The mutation is saved correctly, but the updateQueries code block does <strong>not</strong> run:</p>

<pre><code>const CreateIMPageWithMutations = graphql(CREATE_IM_MUTATION, {
    props({ ownProps, mutate }) {
        debugger;
        return {
            submit({ fromID, toID, msgText }) { &lt;==SAVES SUCCESSFULLY
                debugger;
                return mutate({
                    variables: {
                        "fromID": fromID,
                        "toID": toID,
                        "msgText": msgText
                    },
                    optimisticResponse: {
                        __typename: 'Mutation',
                        createIM: {
                            __typename: 'createIM',
                            fromID: fromID,
                            toID: toID,
                            createdAt: +new Date,
                            msgText: msgText,
                        },
                    },
                    updateQueries: {
                        createIM: (prev, { mutationResult }) =&gt; {
                            debugger; &lt;== THIS CODE BLOCK IS NEVER CALLED
                            const newMsg = mutationResult.data.createIM;

                            return update(prev, {
                                entry: {
                                    IMs: {
                                        $unshift: [newMsg],
                                    },
                                },
                            });
                        },
                    },
                });
            },
        };
    },
})(CreateIM);
</code></pre>

<p>Why doesn't my updateQueries call run?  Thanks in advance to all for any info.</p>

<p><strong>Update:</strong> per request, here is the code of CREATE_IM_MUTATION:</p>

<pre><code>const CREATE_IM_MUTATION = gql`
                mutation createIM ($fromID: String!, $toID: String!, $msgText: String!){
                    createIM(fromID: $fromID, toID: $toID, msgText: $msgText){
                        fromID
                        toID
                        msgText
                    }
                }
`;
</code></pre>

<p><strong>Update:</strong> Per request of @fabio_oliveira on Slack, here is the query I am updating:</p>

<pre><code>const GETIMS_QUERY = gql`
query getIMs($fromID: String!, $toID: String!){
  instant_message(fromID:$fromID, toID: $toID){
    id,
    fromID,
    toID,
    msgText
  }
}  `;
</code></pre>