One resource with multiple __typenames

Hey Apollo Community,

The problem we’ve been facing is that we have certain resources that can occasionally also appear with different __typenames. These alternative __typenames usually extend the original one. However, when performing cache updates, only one specific “version” (__typename) gets updated (as expected), and the others do not.

As a simple example:

interface BaseResource {
  name: String!
  age: Number!
}

type OriginalResource implements BaseResource {
  name: String!
  age: Number!
}

type ExtendedResource implements BaseResource {
  name: String!
  age: Number!
  extraField: Number!
}

There are queries that resolve OriginalResource, but some resolve ExtendedResource (the extra fields, in this case extraField is obviously not available when resolving OriginalResource). Hence, in the normalized cache there can be both OriginalResource:1 and ExtendedResource:1. When updating ExtendedResource:1.name, one would expect OriginalResource:1 to also reflect the changes, but Apollo Client is not aware of any connection between the two.

My question is whether Apollo (Client) has some neat feature to deal with this or we should restructure the schema.