title: Apollo js Subscriptions Optimistic UI
body: <p>Does it make sense having Optimistic UI with subscriptions?</p>
  
  <p>So basically:</p>
  
  <pre><code>addChannelMutation({
    variables: { name: eventValue },
    optimisticResponse: {
      __typename: "Mutation",
      addChannel: {
        __typename: "Channel",
        id: data.channels.length,
        name: eventValue
      }
    },
    update: (store, { data: { addChannel } }) =&gt; {
      // Read the data from our cache for this query.
      const data = store.readQuery({ query: channelsListQuery });
      // Add our comment from the mutation to the end.
      data.channels.push(addChannel);
      // Write our data back to the cache.
      store.writeQuery({ query: channelsListQuery, data });
    }
  }).then(res =&gt; {});
  </code></pre>
  
  <p>It adds twice the same item triggering a duplicate key exception.
  Thus does optimistic ui make sense with subscriptions?</p>