On this page

Changelog

Every Apollo Angular release with its changes and the pull requests behind them.

14.2.0

Minor Changes

14.1.0

Minor Changes

Patch Changes

14.0.0

Major Changes

  • #2395 4e9f107 Thanks @JesseZomer! - BREAKING CHANGE: HTTP errors now return Apollo Client’s ServerError instead of Angular’s HttpErrorResponse

    When Apollo Server returns non-2xx HTTP status codes (status >= 300), apollo-angular’s HTTP links now return ServerError from @apollo/client/errors instead of Angular’s HttpErrorResponse. This enables proper error detection in errorLinks using ServerError.is(error) and provides consistent error handling with Apollo Client’s ecosystem.

    Migration Guide:

    Before:

    import { HttpErrorResponse } from '@angular/common/http';
    
    link.request(operation).subscribe({
      error: err => {
        if (err instanceof HttpErrorResponse) {
          console.log(err.status);
          console.log(err.error);
        }
      },
    });

    After:

    import { ServerError } from '@apollo/client/errors';
    
    link.request(operation).subscribe({
      error: err => {
        if (ServerError.is(err)) {
          console.log(err.statusCode);
          console.log(err.bodyText);
          console.log(err.response.headers);
        }
      },
    });

    Properties Changed:

    • err.status → err.statusCode
    • err.error → err.bodyText (always string, JSON stringified for objects)
    • err.headers (Angular HttpHeaders) → err.response.headers (native Headers)
    • Access response via err.response which includes: status, statusText, ok, url, type, redirected

    Note: This only affects HTTP-level errors (status >= 300). Network errors and other error types remain unchanged. GraphQL errors in the response body are still processed normally through Apollo Client’s error handling.

    Fixes #2394

Patch Changes

  • #2392 8d2be64 Thanks @vz-tl! - Allow headers type in DefaultContext to be Record or HttpHeaders

13.0.0

Major Changes

Minor Changes

  • #2390 7ae276c Thanks @vz-tl! - Support HttpContext in HttpLink option and operation context

12.1.0

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.

12.0.0

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

11.0.0

Major Changes

Patch Changes

10.0.3

Patch Changes

10.0.2

Patch Changes

10.0.1

Patch Changes

10.0.0

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';

9.0.0

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. diff - 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

8.0.2

Patch Changes

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

8.0.1

Patch Changes

8.0.0

Major Changes

  • #2316 8c75368 Thanks @Frozen-byte! - added a complete() method for TestOperation object to cancel subscriptions after flush()

    BREAKING CHANGE: subscription observables must be manually completed by the complete() method.

Patch Changes

7.2.1

Patch Changes

  • #2312 8bbdc6b Thanks @PowerKiKi! - Smaller bundle for gql

  • #2314 e98e06a Thanks @PowerKiKi! - Deprecate graphql alias for gql tag function

    Because importing the same thing from two different import points will increase the final bundle size. If you want a different name for the tag function, then use as syntax, such as:

    import { gql as graphql } from 'apollo-angular';

7.2.0

Minor Changes

Patch Changes

7.1.2

Patch Changes

7.1.1

Patch Changes

7.1.0

Minor Changes

7.0.2

Patch Changes

7.0.1

Patch Changes

7.0.0

Major Changes

  • #2225 712205f Thanks @PowerKiKi! - BREAKING use Typescript strict mode

    This is breaking because:

    • ApolloBase.client throws an error if no client has been created beforehand. The behavior now matches the typing that always declared a client existed. In most cases, you should pass either apolloOptions or apolloNamedOptions to Apollo.constructor to create the client immediately upon construction.
    • ApolloBase.query(), ApolloBase.mutate() and ApolloBase.subscribe() all have a new constraint on V. If you inherit from this class, you might need to adjust your typing.
    • Classes that inherit Query, Mutation and Subscription must declare the document member. This requirement always existed at runtime but was not enforced at compile time until now. If you generated code, you have nothing to do.
    • QueryRef.getLastResult() and QueryRef.getLastError() might return undefined. This was always the case, but was typed incorrectly until now.
    • pickFlag() was dropped without any replacement.
    • createPersistedQueryLink() requires options. This was always the case but was typed incorrectly until now.

6.0.0

Major Changes

  • #2093 fbd86daf Thanks @PowerKiKi! - - Add Angular 17 Support
    • Drop support for Angular 14, 15 and 16
    • Support for ng add schematics for standalone apps or module apps

Patch Changes

5.0.2

Patch Changes

5.0.1

Patch Changes

5.0.0

Major Changes

  • #2010 ea8b7034 Thanks @HendrikJanssen! - Support Angular 16

    This is a breaking change because support for node v14 must be dropped to follow Angular 16 requirements.

4.2.1

Patch Changes

  • #1910 ff0b0d72 Thanks @phryneas! - TVariable generics now extend OperationVariables to accommodate an upstream type change in @apollo/client@3.7.6. #1910, #1907

v4.2.0

  • Support Angular 15
  • Support Node 18
  • Fix broken published package

v4.1.1

  • Fix creating default client when using named options (APOLLO_NAMED_OPTIONS)
  • Support newest zone.js #1841

v4.1.0

  • Support @apollo/client v3.7.X
  • Fix typescript issue with MutationResult type #1818

v4.0.1

  • Add missing apollo-angular/persisted-queries and apollo-angular/testing

v4.0.0

  • Support Angular v14

v3.0.1

  • Fix previously corrupted distribution of apollo-angular package.

v3.0.0

  • useGETForQueries in Http Link 5996109
  • Bring back ApolloModule 0a24c4f
  • Fix useInitialLoading 750429c
  • Typed gql and graphql tags - both accept two generic types and support TypedDocumentNode 9a8ea5f
  • Add useMutationLoading flag bc223fe
  • Fix type inference for Mutations #1659
  • Declare support for Angular 13
  • Remove extract-files library from dependencies (you need to pass extractFiles function to HttpLink’s options)

Migration from v2 to v3

  1. Use ApolloModule in your NgModule to provide Apollo service
  2. If you’re using old version of graphql, update to latest v15 or v16.
  3. In case of file uploads, import extractFiles from extract-files library and pass it to HttpLink.create({ ..., extractFiles })
  4. Done.

v2.6.0

  • Support TypedDocumentNode 120594a

v2.5.0

  • Declare support for Angular 12

v2.4.0

  • Fix: Use let in Apollo constructor due to firefox bug #1632
  • Adds operationPrinter option to replace operation printing logic in HttpLink and HttpBatchLink #1637

v2.3.0

  • 830da182 build: Allows zone.js v11 #1629
  • 136663f0 docs: Update queries.md #1616

v2.2.0

  • b152d53 Added Angular 11 peer dependency #1615
  • d179a66 docs: Integrated documentation changes #1590
  • 5d938a3 Update README.md #1598
  • 60b8445 fix: test data modification #1596

v2.1.0

  • Move apollo-angular-link-persisted to apollo-angular/persisted-queries (support Apollo Client 3.0)
  • Support clientAwareness (apollographql-client-name and apollographql-client-version headers) in HttpLink and HttpBatchLink

v2.0.4

  • Fix v2 migration: default export (ApolloClient) of apollo-client
  • Use TypeScript to parse JSON files (supports comments in JSON)

v2.0.3

  • Use JSON.parse to parse package.json file in v2 migration

v2.0.2

  • Fix duplicated imports in v2 migration

v2.0.1

  • Fix missing migration code

v2.0.0

Migration from v1.0 to v2.0:

ng update apollo-angular

List of breaking changes and a migration strategy available on our “Migration Guide”.

Changes:

  • Support Apollo Client 3.0 (use @apollo/client/core)
  • Http, HttpBatch and Headers links are now part of apollo-angular: apollo-angular/http and apollo-angular/headers
  • Re-export gql of graphql-tag (import { gql } from 'apollo-angular')
  • Add flushData method to TestingOperation (PR #1474 by @fetis)
  • Remove apollo-angular-boost and apollo-angular-cache-ngrx

v1.10.0

  • Support Angular 10

v1.9.1

  • Fix an issue with TypeScript prior v3.5 - private get accessor #1491

v1.9.0

  • Bump version ranges for GraphQL and Apollo Link

v1.8.0

  • Introduces APOLLO_NAMED_OPTIONS token. Allows to create named Apollo clients using Dependency Injection (PR #1365)
  • Allow to test named Apollo client (PR #1365)

v1.7.0

  • Fixed type definition for subscribe PR #1290
  • Fix global scope naming for UMD build PR #1305
  • Introduce useInitialLoading in watch PR #1306

v1.6.0

  • Angular 8 PR #1206
  • Bumps packages in schematics

v1.5.0

  • Use more generic types and make everything more strict PR #885
  • Angular 7 PR #913

v1.4.1

  • schematics: bump dependencies

v1.4.0

  • Support named clients in Query, Mutatio and Subscription classes PR #799

v1.3.0

  • Make Subscription generic PR #778
  • Schematics (ng add apollo-angular) PR #779, PR #780
  • Allow to use a custom ApolloCache while testing PR #786

v1.2.0

  • Expose queryId in QueryRef PR #733
  • Introduce Query, Mutation, Subscription services PR #622
  • Angular 6.1 is now required (because of TypeScript 2.8)
  • TypeScript 2.8 is now required (because of Omit type)
  • Apollo Client ^2.3.4 is now required (versions before are not compatible because of the change in apollo-client)

v1.1.2

v1.1.1

  • Fix typescript compilation errors caused by recent Apollo Client interface changes. Issue #659 PR #660

v1.1.0

  • Introduces ExtraSubscriptionOptions. Allows to run Apollo.subscribe outside the Zone (PR #488)
  • Introduces apollo-angular/testing tools (PR #592)
  • Introduces APOLLO_OPTIONS token. Allows to create Apollo using Dependency Injection (PR #607)
  • Adds sideEffects: false (webpack) (PR #580)
  • Supports Angular 6 and RxJS 6 (PR #580)

v1.0.1

  • Brings typed variables to QueryRef

v1.0.0

  • Supports ApolloClient 2.0
  • Supports ApolloLinks and ApolloCache
  • Supports Angular v5
  • Possible to combine Apollo with anything from Angular’s Dependency Injection
  • Supports NativeScript
  • Simpler and less error prone API for watching queries thanks to QueryRef
  • More AoT friendly
  • Brings back Server-Side Rendering
  • Allows to type the operation variables

BREAKING CHANGES: - see Migration

  • Drops apollo-client-rxjs (thanks to QueryRef)
  • ReplacesApolloQueryObservable with QueryRef
  • Introduces new API for defining multiple clients (Apollo.create, Apollo.createDefault, Apollo.createNamed)
  • No longer exposes ClientMap, ClientMapWrapper, ClientWrapper
  • Removes ‘variables as Observables’ feature

v0.13.3

  • Don’t reuse options object for mutate and query (PR #356)

v0.13.2

  • Use InjectionToken, instead of deprecated OpaqueToken (PR #358)
  • Expose ClientMap, ClientMapWrapper, ClientWrapper (PR #360)
  • Allow to install the library directly from git (NPM v5+ required) (PR #362)
  • Fix AoT issue in Angular 5 (added InjectDecorator on ClientMap in Apollo) (PR #365)

v0.13.1

  • Update dependencies (PR #347)
  • Potential breaking change: Run a GraphQL Operation on subscribe, applies to mutate() and query() (PR #304)

v0.13.0

  • Run subscribe, mutate and query within a Zone (PR #297)

v0.12.0

  • Support apollo-client@1.0.0-rc.2 (PR #290)
  • Support jsnext:main (PR #277)

v0.11.0

  • Remove DeprecatedWatchQueryOptions and use WatchQueryOptions (PR #274)

After updating to (apollo-client-rxjs@0.5.0)

  • Add result(), currentResult(), variables, setOptions, setVariables to ApolloQueryObservable
  • BREAKING CHANGE: ApolloQueryObservable shares now a generic type with ApolloQueryResult

Before:

class AppComponent {
  users: ApolloQueryObservable<ApolloQueryResult<{}>>;
}

Now:

class AppComponent {
  users: ApolloQueryObservable<{}>;
}

Behaves the same as the ObservableQuery of apollo-client.

v0.10.0

  • BRAKING CHANGE Change name of the service to Apollo, instead of Angular2Apollo (PR #262)
  • Introduce multiple clients (PR #263)

v0.9.0

  • Support apollo-client@0.8.0 (PR #206)
  • Support es6 modules and tree-shaking (PR #151, PR #206)
  • Make our Ahead-of-Time compilation compatible with Angular 2.3+ (PR #189, PR #195)
  • Added getClient() that exposes an instance of ApolloClient (PR #203)
  • BREAKING CHANGE The way to provide an instance of ApolloClient has changed, see how
  • BREAKING CHANGE Change the name of the package. Use apollo-angular instead of angular2-apollo, which is now deprecated

v0.8.0

  • Made mutate() and query() methods to return Observable instead of Promise (PR #140)
  • Use types of options (for watchQuery, query, mutate) ( PR #145, PR #146, PR #148 )

v0.7.0

  • Added support for Ahead of Time compilation (PR #124)

v0.6.0

  • Added support for ApolloClient v0.5.X ([PR #])
  • Added subscribeToMore function (PR)
  • BREAKING CHANGE No no longer support ApolloClient v0.4.X
  • BREAKING CHANGE Removed Apollo decorator (use Angular2Apollo service)
  • BREAKING CHANGE Removed ApolloQueryPipe (use SelectPipe instead)

v0.5.0

  • Added subscribe method to Angular2Apollo service (PR #113)
  • Added updateQuery to ApolloQueryObservable (PR #113)
  • Deprecated ApolloQueryPipe (use SelectPipe instead)
  • Deprecated Apollo decorator (use Angular2Apollo service)
  • BREAKING CHANGE No longer support for ApolloClient v0.3.X

v0.4.6

  • Moved to Angular 2 final and updated RxJS to the latest version (PR #96)

v0.4.5

v0.4.4

  • Fixed format of arguments in backward compatible methods (PR #74)
  • Made queries reusable (use refetch on new variables) (PR #74)
  • Used apollo-client-rxjs (PR #72)
  • Fixed an issue that prevents from subscribing to ApolloQueryObservable (PR #71)
  • Added SelectPipe and deprecated ApolloQueryPipe (PR #78)

v0.4.3

  • Added ApolloModule (with RC5 of Angular2 comes NgModules) (PR #63)
  • Added ability to use query variables as observables. With this, the query can be automatically re-run when those obserables emit new values. (PR #64)

v0.4.2

  • Added fetchMore support (PR #58)
  • Exposed ApolloQueryObservable in the index module (PR #54)
  • Added support for getting loading state from ApolloQueryResult Issue #36 (PR #43)
  • Fixed ApolloQueryObservable incompatibility with Rx.Observable (PR #59)

v0.4.1

  • Added ApolloQueryObservable to support Rx.Observable in Angular2Apollo.watchQuery method (PR #52)
  • Added query method to Angular2Apollo service (PR #51)

v0.4.0

  • Passing all the options of mutation in Apollo decorator PR #39
  • Added support for apollo-client breaking change that moves methods to query’s observable (PR #40)
  • Replaced lodash with subpackages, removed graphql-tag from dependencies, moved apollo-client and @angular/core to peerDependecies (PR #44)
  • Added ApolloQuery interface (PR #45)

v0.3.0

  • Added SSR support
  • Left lodash as the only one dependency and @angular/core with apollo-client as peerDependecies (PR #29)
  • Fixed missing data in reused component (PR #30)
  • Fixed overwriting query data with the same value on every poll interval (PR #34)

v0.2.0

  • Added polling, refetching and access to unsubscribe method (PR #19)
  • Added forceFetch, returnPartialData and pollInterval support (PR #19)
  • Added errors and loading to the query’s result object (PR #19)
  • Added both results from decorator and service support for ApolloQueryPipe (PR #27)
  • Fixed issue with not setting a query with not defined variables (PR #19)

v0.1.0

  • Added Angular2 RC1 and ApolloClient 0.3.X support (PR #16, PR #17)

v0.0.2

v0.0.1

Initial release. We didn’t track changes before this version.