Skip to content

Commit 2f35feb

Browse files
committed
Add section on TSerialized generic removal
1 parent 37555ce commit 2f35feb

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

docs/source/migrating/apollo-client-4-migration.mdx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,6 +1567,17 @@ new ApolloClient({ // [!code ++]
15671567
});
15681568
```
15691569
1570+
### Removal of `<TSerialized>` generic argument
1571+
1572+
The `TSerialized` generic argument has been removed from the `ApolloCache` abstract class. Most users set this type to `any` which provided little benefit for type safety. APIs that previously relied on `TSerialized` are now set to `unknown`.
1573+
1574+
To migrate, remove the `TSerialized` generic argument when referencing `ApolloCache`.
1575+
1576+
```ts
1577+
const cache: ApolloCache<any> = ... // [!code --]
1578+
const cache: ApolloCache = ... // [!code ++]
1579+
```
1580+
15701581
## Apollo Link changes
15711582

15721583
### New class-based links

0 commit comments

Comments
 (0)