github apollographql/apollo-client v3.8.0-beta.3

latest releases: v3.11.10, v3.11.9, v3.12.0-alpha.0...
pre-release15 months ago

3.8.0-beta.3

Minor Changes

  • #10895 e187866fd Thanks @(author)! - Add generic type parameter for the entity modified in cache.modify. Improves
    TypeScript type inference for that type's fields and values of those fields.

    Example:

    cache.modify<Book>({
      id: cache.identify(someBook),
      fields: {
        title: (title) => {
          // title has type `string`.
          // It used to be `any`.
        },
     => {
          // author has type `Reference | Book["author"]`.
          // It used to be `any`.
        },
      },
    });
  • #10895 e187866fd Thanks @Gelio! - Use unique opaque types for the DELETE and INVALIDATE Apollo cache modifiers.

    This increases type safety, since these 2 modifiers no longer have the any type.
    Moreover, it no longer triggers the @typescript-eslint/no-unsafe-return
    rule
    .

Patch Changes

  • #10951 2e833b2ca Thanks @alessbell! - Improve useBackgroundQuery type interface

  • #10964 f33171506 Thanks @alessbell! - Fixes a bug in BatchHttpLink that removed variables from all requests by default.

  • #10968 b102390b2 Thanks @phryneas! - Use printed query for query deduplication. Cache print calls for GraphQL documents to speed up repeated operations.

  • #10969 525a9317a Thanks @phryneas! - Slightly decrease bundle size and memory footprint of SuspenseCache by changing how cache entries are stored internally.

Don't miss a new apollo-client release

NewReleases is sending notifications on new releases.