Changelog
Every Apollo Angular release with its changes and the pull requests behind them.
14.2.0
Minor Changes
- #2432
5710418Thanks @PowerKiKi! - Compatibility with GraphQL 17
14.1.0
Minor Changes
- #2405
299be98Thanks @PowerKiKi! - Support Angular 22
Patch Changes
-
#2405
6cbf6b7Thanks @PowerKiKi! - dependencies updates:- Updated dependency
@angular/core@^20.0.0 || ^21.0.0 || ^22.0.0↗︎ (from^19.0.0 || ^20.0.0 || ^21.0.0, inpeerDependencies)
- Updated dependency
-
#2405
299be98Thanks @PowerKiKi! - ng-add schematics drop support for NgModule applications
14.0.0
Major Changes
-
#2395
4e9f107Thanks @JesseZomer! - BREAKING CHANGE: HTTP errors now return Apollo Client’sServerErrorinstead of Angular’sHttpErrorResponseWhen Apollo Server returns non-2xx HTTP status codes (status >= 300), apollo-angular’s HTTP links now return
ServerErrorfrom@apollo/client/errorsinstead of Angular’sHttpErrorResponse. This enables proper error detection in errorLinks usingServerError.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.statusCodeerr.error→err.bodyText(always string, JSON stringified for objects)err.headers(Angular HttpHeaders) →err.response.headers(native Headers)- Access response via
err.responsewhich 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
13.0.0
Major Changes
-
#2389
b43359cThanks @matictrebusak! - Drop support for Angular 18 -
#2389
b43359cThanks @matictrebusak! - Support for Angular 21
Minor Changes
12.1.0
Minor Changes
-
#2382
d21e7f9Thanks @PowerKiKi! - NewonlyCompleteFragment()Same as
onlyCompleteData()but forApollo.watchFragment().
Patch Changes
-
#2381
679dba2Thanks @PowerKiKi! - RenameonlyComplete()intoonlyCompleteData()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
44ed9a5Thanks @jerelmiller! - Namespaced typesBefore:
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
bdc93dfThanks @jerelmiller! -httpHeadersis a classMigrate your code like so:
- const link = httpHeaders(); + const link = new HttpHeadersLink(); -
#2372
8c0b7f0Thanks @jerelmiller! - MoveuseZoneoption into subscription options- const obs = apollo.subscribe(options, { useZone: false }); + const obs = apollo.subscribe({ ...options, useZone: false }); -
#2372
b9c62a5Thanks @jerelmiller! - Combined parameters ofQuery,MutationandSubscriptionclasses generated via codegenMigrate 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
7e4a609Thanks @PowerKiKi! - NewonlyComplete()helper to filter only complete resultsIf you use this, you should probably combine it with
notifyOnNetworkStatusChange. This tells@apollo/clientto not emit the firstpartialresult, soapollo-angulardoes 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
-
#2355
226a963Thanks @PowerKiKi! - dependencies updates:- Updated dependency
@apollo/client@^4.0.1↗︎ (from^3.13.1, inpeerDependencies) - Updated dependency
rxjs@^7.3.0↗︎ (from^6.0.0 || ^7.0.0, inpeerDependencies)
- Updated dependency
-
#2373
e65bcceThanks @PowerKiKi! - Drop support for node 18 -
#2366
bdff9d9Thanks @PowerKiKi! - Drop ESM2022 in favor of FESM2022 -
#2368
0f10355Thanks @PowerKiKi! - New repository owners@kamilkisiela, the creator of this library, has found new interests and is not able to contribute like in the past. He gracefully transferred ownership of the repository to me. I have been maintaining this library since 2022, and will continue doing so in the foreseeable future.
For the package consumers, pretty much nothing will change. The package name, the code, the relation with The Guild, and the maintenance style will all remain the same. The only difference is the new repository URL: https://github.com/the-guild-org/apollo-angular.
11.0.0
Major Changes
-
#2360
20a418eThanks @mark7-bell! - Drop support for Angular 17 -
#2364
bdb302aThanks @PowerKiKi! - Drop support for GraphQL 15 -
#2360
f311133Thanks @mark7-bell! - Support Angular 20
Patch Changes
- #2364
bdb302aThanks @PowerKiKi! - dependencies updates:- Updated dependency
graphql@^16.0.0↗︎ (from^15.0.0 || ^16.0.0, inpeerDependencies)
- Updated dependency
10.0.3
Patch Changes
- #2351
61ff0b8Thanks @PowerKiKi! -fetchMoretyping is duplicated from@apollo/client
10.0.2
Patch Changes
- #2347
67b8b8cThanks @PowerKiKi! -fetchMoretyping was too loose
10.0.1
Patch Changes
- #2344
3ef5483Thanks @PowerKiKi! -FormattedExecutionResultinstead ofExecutionResult
10.0.0
Major Changes
- #2342
baf538aThanks @PowerKiKi! - Drop deprecated things:- Instead of
ApolloModule, use eitherprovideApollo()orprovideNamedApollo(). - Instead of
import {graphql} from 'apollo-angular';useimport {gql as graphql} from 'apollo-angular';
- Instead of
9.0.0
Major Changes
- #2340
6d3d5baThanks @PowerKiKi! - - Requires@apollo/client3.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
QueryRefforward types from@apollo/client. That should allow always using correct types from whichever@apollo/clientversion is installed without needing to touchapollo-angular. QueryRef.valueChangesandQueryRef.queryIdare readonly, because there is no reason for those to be re-affected.
- Dropped
Patch Changes
- #2340
88656f0Thanks @PowerKiKi! - dependencies updates:- Updated dependency
@apollo/client@^3.13.1↗︎ (from^3.10.0, inpeerDependencies)
- Updated dependency
8.0.2
Patch Changes
- #2336
78b0ba1Thanks @PowerKiKi! - Export MutationOptionsAlone, QueryOptionsAlone, SubscriptionOptionsAlone, WatchQueryOptionsAlone from ‘apollo-angular’
8.0.1
Patch Changes
-
#2333
9866ec6Thanks @PowerKiKi! - dependencies updates:- Updated dependency
@apollo/client@^3.10.0↗︎ (from^3.0.0, inpeerDependencies)
- Updated dependency
-
#2333
eeec0a9Thanks @PowerKiKi! - Requires @apollo/client ^3.10.0 for watchFragment
8.0.0
Major Changes
-
#2316
8c75368Thanks @Frozen-byte! - added acomplete()method forTestOperationobject to cancel subscriptions afterflush()BREAKING CHANGE: subscription observables must be manually completed by the
complete()method.
Patch Changes
-
#2323
095457dThanks @PowerKiKi! - dependencies updates:- Updated dependency
@angular/core@^17.0.0 || ^18.0.0 || ^19.0.0↗︎ (from^17.0.0 || ^18.0.0, inpeerDependencies)
- Updated dependency
-
#2319
cafb23aThanks @PowerKiKi! - Move away from deprecated things -
#2317
a564953Thanks @PowerKiKi! - Let typing flow better
7.2.1
Patch Changes
-
#2312
8bbdc6bThanks @PowerKiKi! - Smaller bundle forgql -
#2314
e98e06aThanks @PowerKiKi! - Deprecategraphqlalias forgqltag functionBecause 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
assyntax, such as:import { gql as graphql } from 'apollo-angular';
7.2.0
Minor Changes
- #2296
6a45784Thanks @PowerKiKi! - NewprovideApollo()andprovideNamedApollo()
Patch Changes
-
#2294
d56c5cbThanks @PowerKiKi! - Update documentation to standalone usage -
#2292
04fdd28Thanks @PowerKiKi! - Relax type to be able to useextract-filesproperly
7.1.2
Patch Changes
- #2289
d78cc8dThanks @richard-elastique! - Don’t require a dependency on React
7.1.1
Patch Changes
- #2286
dbd4f68Thanks @PowerKiKi! - Permissions for release provenance
7.1.0
Minor Changes
- #2226
4ca9c4aThanks @alessbell! - ExposeswatchFragmentmethod on theApolloBaseclass.
7.0.2
Patch Changes
-
#2259
78f319aThanks @PowerKiKi! - dependencies updates:- Updated dependency
@angular/core@^17.0.0 || ^18.0.0↗︎ (from^17.0.0, inpeerDependencies)
- Updated dependency
-
#2259
97fba6aThanks @PowerKiKi! - dependencies updates:- Updated dependency
@angular/core@^17.0.0 || ^18.0.0↗︎ (from^17.0.0, inpeerDependencies)
- Updated dependency
-
#2259
29b9fdcThanks @PowerKiKi! - Allow Angular 18
7.0.1
Patch Changes
- #2252
67ba1e8Thanks @PowerKiKi! - ApolloClient does not delay the application becoming stable
7.0.0
Major Changes
-
#2225
712205fThanks @PowerKiKi! - BREAKING use Typescript strict modeThis is breaking because:
ApolloBase.clientthrows 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 eitherapolloOptionsorapolloNamedOptionstoApollo.constructorto create the client immediately upon construction.ApolloBase.query(),ApolloBase.mutate()andApolloBase.subscribe()all have a new constraint onV. If you inherit from this class, you might need to adjust your typing.- Classes that inherit
Query,MutationandSubscriptionmust declare thedocumentmember. 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()andQueryRef.getLastError()might returnundefined. 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
fbd86dafThanks @PowerKiKi! - - Add Angular 17 Support- Drop support for Angular 14, 15 and 16
- Support for
ng addschematics for standalone apps or module apps
Patch Changes
- #2093
e0bec09aThanks @PowerKiKi! - dependencies updates:- Updated dependency
@angular/core@^17.0.0↗︎ (from^14.0.0 || ^15.0.0 || ^16.0.0, inpeerDependencies)
- Updated dependency
5.0.2
Patch Changes
5.0.1
Patch Changes
- #2065
78947ba5Thanks @PowerKiKi! - dependencies updates:- Updated dependency
tslib@^2.6.2↗︎ (from^2.0.0, independencies)
- Updated dependency
5.0.0
Major Changes
-
#2010
ea8b7034Thanks @HendrikJanssen! - Support Angular 16This is a breaking change because support for node v14 must be dropped to follow Angular 16 requirements.
4.2.1
Patch Changes
- #1910
ff0b0d72Thanks @phryneas! -TVariablegenerics nowextend OperationVariablesto 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/clientv3.7.X - Fix typescript issue with
MutationResulttype #1818
v4.0.1
- Add missing
apollo-angular/persisted-queriesandapollo-angular/testing
v4.0.0
- Support Angular v14
v3.0.1
- Fix previously corrupted distribution of
apollo-angularpackage.
v3.0.0
useGETForQueriesin Http Link5996109- Bring back
ApolloModule0a24c4f - Fix
useInitialLoading750429c - Typed
gqlandgraphqltags - both accept two generic types and supportTypedDocumentNode9a8ea5f - Add
useMutationLoadingflagbc223fe - Fix type inference for Mutations #1659
- Declare support for Angular 13
- Remove
extract-fileslibrary from dependencies (you need to passextractFilesfunction to HttpLink’s options)
Migration from v2 to v3
- Use
ApolloModulein your NgModule to provideApolloservice - If you’re using old version of
graphql, update to latest v15 or v16. - In case of file uploads, import
extractFilesfromextract-fileslibrary and pass it toHttpLink.create({ ..., extractFiles }) - Done.
v2.6.0
- Support
TypedDocumentNode120594a
v2.5.0
- Declare support for Angular 12
v2.4.0
- Fix: Use let in Apollo constructor due to firefox bug #1632
- Adds
operationPrinteroption to replace operation printing logic inHttpLinkandHttpBatchLink#1637
v2.3.0
v2.2.0
b152d53Added Angular 11 peer dependency #1615d179a66docs: Integrated documentation changes #15905d938a3Update README.md #159860b8445fix: test data modification #1596
v2.1.0
- Move
apollo-angular-link-persistedtoapollo-angular/persisted-queries(support Apollo Client 3.0) - Support
clientAwareness(apollographql-client-nameandapollographql-client-versionheaders) inHttpLinkandHttpBatchLink
v2.0.4
- Fix v2 migration: default export (
ApolloClient) ofapollo-client - Use TypeScript to parse JSON files (supports comments in JSON)
v2.0.3
- Use JSON.parse to parse
package.jsonfile 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,HttpBatchandHeaderslinks are now part of apollo-angular:apollo-angular/httpandapollo-angular/headers- Re-export
gqlofgraphql-tag(import { gql } from 'apollo-angular') - Add
flushDatamethod toTestingOperation(PR #1474 by @fetis) - Remove
apollo-angular-boostandapollo-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_OPTIONStoken. 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
v1.4.1
- schematics: bump dependencies
v1.4.0
- Support named clients in Query, Mutatio and Subscription classes PR #799
v1.3.0
- Make
Subscriptiongeneric 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
queryIdinQueryRefPR #733 - Introduce
Query,Mutation,Subscriptionservices 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 runApollo.subscribeoutside the Zone (PR #488) - Introduces
apollo-angular/testingtools (PR #592) - Introduces
APOLLO_OPTIONStoken. 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 toQueryRef) - Replaces
ApolloQueryObservablewithQueryRef - 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 deprecatedOpaqueToken(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()andquery()(PR #304)
v0.13.0
- Run
subscribe,mutateandquerywithin a Zone (PR #297)
v0.12.0
v0.11.0
- Remove
DeprecatedWatchQueryOptionsand useWatchQueryOptions(PR #274)
After updating to
(apollo-client-rxjs@0.5.0)
- Add
result(),currentResult(),variables,setOptions,setVariablestoApolloQueryObservable - BREAKING CHANGE:
ApolloQueryObservableshares now a generic type withApolloQueryResult
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 ofAngular2Apollo(PR #262) - Introduce multiple clients (PR #263)
v0.9.0
- Support
apollo-client@0.8.0(PR #206) - Support
es6modules andtree-shaking(PR #151, PR #206) - Make our
Ahead-of-Timecompilation 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-angularinstead ofangular2-apollo, which is now deprecated
v0.8.0
- Made
mutate()andquery()methods to returnObservableinstead ofPromise(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
subscribeToMorefunction (PR) - BREAKING CHANGE No no longer support ApolloClient
v0.4.X - BREAKING CHANGE Removed
Apollodecorator (useAngular2Apolloservice) - BREAKING CHANGE Removed
ApolloQueryPipe(useSelectPipeinstead)
v0.5.0
- Added
subscribemethod toAngular2Apolloservice (PR #113) - Added
updateQuerytoApolloQueryObservable(PR #113) - Deprecated
ApolloQueryPipe(useSelectPipeinstead) - Deprecated
Apollodecorator (useAngular2Apolloservice) - 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
SelectPipeand deprecatedApolloQueryPipe(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
fetchMoresupport (PR #58) - Exposed
ApolloQueryObservablein the index module (PR #54) - Added support for getting
loadingstate from ApolloQueryResult Issue #36 (PR #43) - Fixed
ApolloQueryObservableincompatibility withRx.Observable(PR #59)
v0.4.1
- Added
ApolloQueryObservableto supportRx.ObservableinAngular2Apollo.watchQuerymethod (PR #52) - Added
querymethod toAngular2Apolloservice (PR #51)
v0.4.0
- Passing all the options of mutation in
Apollodecorator PR #39 - Added support for
apollo-clientbreaking change that moves methods to query’s observable (PR #40) - Replaced
lodashwith subpackages, removedgraphql-tagfrom dependencies, movedapollo-clientand@angular/coreto peerDependecies (PR #44) - Added
ApolloQueryinterface (PR #45)
v0.3.0
- Added SSR support
- Left
lodashas the only one dependency and@angular/corewithapollo-clientas 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,returnPartialDataandpollIntervalsupport (PR #19) - Added
errorsandloadingto 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
v0.0.2
v0.0.1
Initial release. We didn’t track changes before this version.