How to cache graphs with a wrapper response

We have a GQL api that has this extra wrapper in the response it has no ids and has localised errors in the response, however Apollo won’t automatically cache the graphs. Right now it will still make the API but cache the inner todo but because the outer todo object has no id and has an error property, it won’t cache the response.

Is the extra nesting which lacks ids a big problem for apollo when it comes to caching?
How do we efficiently setup caching?

Examples below.

Plural query:

query Todos($input: TodosInput!) {
  todos(input: $input) {
    todos {
      id
      title
      completed
    }
    errors {
      message
    }
  }
}

Singular query:

query Todo($input: TodoInput!) {
  todo(input: $input) {
    todo {
      id
      title
      completed
    }
    errors {
      message
    }
  }
}

By default, Apollo’s cache builds its cache keys using the __typename and id (or _id) fields, but you can customize that behavior using typePolicies and the keyFields option. Assuming your todos query returns an object with the typename TodosResult:

const cache = new InMemoryCache({
    typePolicies: {
        TodosResult: {
            keyFields: [],
        },
    },
});

keyFields will have to contain the field(s) by which your TodosResult can be identified. If there is neither an id field nor any other fields that your API can expose to identify a TodosResult, you can even nest your keyFields to include fields deeper in the tree: keyFields: ['todos', ['id']]

For more details: Configuring the cache - Client (React) - Apollo GraphQL Docs