title: Manual data normalization in Apollo Client v3
body: <p>In my graphql schema I have two different types: <code>UserPlaylist</code> and <code>ArtistPlaylist</code>. One type can become the other via mutation. So <code>UserPlaylist</code> can become <code>ArtistPlaylist</code> and vice versa.</p>
  <p>To handle this case on the client I manually replace these types into one common <code>Playlist</code> type.
  My <code>InMemoryCache</code> configuration:</p>
  <pre><code>const InMemoryCache = new InMemoryCache({
      dataIdFromObject: (object) =&gt; {
      switch (object.__typename) {
        case 'UserPlaylist':
        case 'ArtistPlaylist':
          return `Playlist:${object.id}`;
  
        default: return defaultDataIdFromObject(object);
      }
  })
  </code></pre>
  <p>The problem is <code>dataIdFromObject</code> is deprecated in Apollo Client v3 but I can't seem to find the appropriate replacement.</p>