Skip to content

Releases: the-guild-org/apollo-angular

[email protected]

22 Oct 03:54
d8306e5

Choose a tag to compare

Minor Changes

  • #2382
    d21e7f9
    Thanks @PowerKiKi! - New onlyCompleteFragment()

    Same as onlyCompleteData() but for Apollo.watchFragment().

Patch Changes

  • #2381
    679dba2
    Thanks @PowerKiKi! - Rename onlyComplete() into
    onlyCompleteData()

    Because it communicates better that it is about the data, and not the stream being completed.

    onlyComplete() will be dropped in the next major version.

[email protected]

13 Oct 06:48
eb46890

Choose a tag to compare

Caution

Before upgrading apollo-angular to v12, be sure to read all the breaking changes from @apollo/client v4 that also applies to apollo-angular.

Major Changes

  • #2372
    44ed9a5
    Thanks @jerelmiller! - Namespaced types

    Before:

    import type {
      MutationOptionsAlone,
      QueryOptionsAlone,
      SubscriptionOptionsAlone,
      WatchQueryOptions,
      WatchQueryOptionsAlone,
    } from 'apollo-angular';
    import type { BatchOptions, Options } from 'apollo-angular/http';
    
    type AllTypes =
      | Options
      | BatchOptions
      | MutationOptionsAlone
      | QueryOptionsAlone
      | SubscriptionOptionsAlone
      | WatchQueryOptions
      | WatchQueryOptionsAlone;

    After:

    import type { Apollo, Mutation, Query, Subscription } from 'apollo-angular';
    import type { HttpBatchLink, HttpLink } from 'apollo-angular/http';
    
    type AllTypes =
      | HttpLink.Options
      | HttpBatchLink.Options
      | Mutation.MutateOptions
      | Query.FetchOptions
      | Subscription.SubscribeOptions
      | Apollo.WatchQueryOptions
      | Query.WatchOptions;
  • #2372
    bdc93df
    Thanks @jerelmiller! - httpHeaders is a class

    Migrate your code like so:

    - const link = httpHeaders();
    + const link = new HttpHeadersLink();
  • #2372
    8c0b7f0
    Thanks @jerelmiller! - Move useZone option into subscription
    options

    - const obs = apollo.subscribe(options, { useZone: false });
    + const obs = apollo.subscribe({ ...options, useZone: false });
  • #2372
    b9c62a5
    Thanks @jerelmiller! - Combined parameters of Query,
    Mutation and Subscription classes generated via codegen

    Migrate your code like so:

    class MyComponent {
      myQuery = inject(MyQuery);
      myMutation = inject(MyMutation);
      mySubscription = inject(MySubscription);
    
      constructor() {
    -    myQuery.watch({ myVariable: 'foo' }, { fetchPolicy: 'cache-and-network' });
    +    myQuery.watch({ variables: { myVariable: 'foo' }, fetchPolicy: 'cache-and-network' })
    
    -    myMutation.mutate({ myVariable: 'foo' }, { errorPolicy: 'ignore' });
    +    myMutation.mutate({ variables: { myVariable: 'foo' }, errorPolicy: 'ignore' });
    
    -    mySubscription.subscribe({ myVariable: 'foo' }, { fetchPolicy: 'network-only' });
    +    mySubscription.subscribe({ variables: { myVariable: 'foo' }, fetchPolicy: 'network-only' });
      }
    }

Minor Changes

  • #2379
    7e4a609
    Thanks @PowerKiKi! - New onlyComplete() helper to filter only
    complete results

    If you use this, you should probably combine it with
    notifyOnNetworkStatusChange.
    This tells @apollo/client to not emit the first partial result, so apollo-angular does not
    need to filter it out. The overall behavior is identical, but it saves some CPU cycles.

    So something like this:

    apollo
      .watchQuery({
        query: myQuery,
        notifyOnNetworkStatusChange: false, // Adding this will save CPU cycles
      })
      .valueChanges.pipe(onlyComplete())
      .subscribe(result => {
        // Do something with complete result
      });

Patch Changes

[email protected]

16 Jun 08:57

Choose a tag to compare

Major Changes

Patch Changes

[email protected]

24 Feb 00:51

Choose a tag to compare

Patch Changes

[email protected]

20 Feb 09:50

Choose a tag to compare

Patch Changes

[email protected]

18 Feb 08:17

Choose a tag to compare

Major Changes

  • #2340
    6d3d5ba
    Thanks @PowerKiKi! - - Requires @apollo/client 3.13.1

  • Dropped SubscriptionResult, because it added extra maintenance work to keep native types in
    sync, and it brought no value over using native type.

    - import type { SubscriptionResult } from 'apollo-angular';
    + import type { FetchResult } from '@apollo/client/core';
    • Most methods of QueryRef forward types from @apollo/client. That should allow always using
      correct types from whichever @apollo/client version is installed without needing to touch
      apollo-angular.
    • QueryRef.valueChanges and QueryRef.queryId are readonly, because there is no reason for
      those to be re-affected.

Patch Changes

[email protected]

18 Feb 14:01

Choose a tag to compare

Patch Changes

[email protected]

18 Feb 09:16

Choose a tag to compare

Major Changes

  • #2342
    baf538a
    Thanks @PowerKiKi! - Drop deprecated things:

    • Instead of ApolloModule, use either provideApollo() or provideNamedApollo().
    • Instead of import {graphql} from 'apollo-angular'; use
      import {gql as graphql} from 'apollo-angular';

[email protected]

03 Feb 14:18

Choose a tag to compare

Patch Changes

  • #2336
    78b0ba1
    Thanks @PowerKiKi! - Export MutationOptionsAlone,
    QueryOptionsAlone, SubscriptionOptionsAlone, WatchQueryOptionsAlone from 'apollo-angular'

[email protected]

29 Jan 07:06

Choose a tag to compare

Patch Changes