Releases: the-guild-org/apollo-angular
[email protected]
Minor Changes
-
#2382
d21e7f9
Thanks @PowerKiKi! - NewonlyCompleteFragment()Same as
onlyCompleteData()but forApollo.watchFragment().
Patch Changes
-
#2381
679dba2
Thanks @PowerKiKi! - RenameonlyComplete()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]
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 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
bdc93df
Thanks @jerelmiller! -httpHeadersis a classMigrate your code like so:
- const link = httpHeaders(); + const link = new HttpHeadersLink();
-
#2372
8c0b7f0
Thanks @jerelmiller! - MoveuseZoneoption into subscription
options- const obs = apollo.subscribe(options, { useZone: false }); + const obs = apollo.subscribe({ ...options, useZone: false });
-
#2372
b9c62a5
Thanks @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
7e4a609
Thanks @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
226a963
Thanks @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
e65bcce
Thanks @PowerKiKi! - Drop support for node 18 -
#2366
bdff9d9
Thanks @PowerKiKi! - Drop ESM2022 in favor of FESM2022 -
#2368
0f10355
Thanks @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.
[email protected]
Major Changes
-
#2360
20a418e
Thanks @mark7-bell! - Drop support for Angular 17 -
#2364
bdb302a
Thanks @PowerKiKi! - Drop support for GraphQL 15 -
#2360
f311133
Thanks @mark7-bell! - Support Angular 20
Patch Changes
- #2364
bdb302a
Thanks @PowerKiKi! - dependencies updates:- Updated dependency
graphql@^16.0.0↗︎ (from
^15.0.0 || ^16.0.0, inpeerDependencies)
- Updated dependency
[email protected]
Patch Changes
- #2351
61ff0b8
Thanks @PowerKiKi! -fetchMoretyping is duplicated from
@apollo/client
[email protected]
Patch Changes
- #2347
67b8b8c
Thanks @PowerKiKi! -fetchMoretyping was too loose
[email protected]
Major Changes
-
#2340
6d3d5ba
Thanks @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.- 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 touch
apollo-angular. QueryRef.valueChangesandQueryRef.queryIdare readonly, because there is no reason for
those to be re-affected.
- Most methods of
Patch Changes
- #2340
88656f0
Thanks @PowerKiKi! - dependencies updates:- Updated dependency
@apollo/client@^3.13.1↗︎ (from
^3.10.0, inpeerDependencies)
- Updated dependency
[email protected]
Patch Changes
- #2344
3ef5483
Thanks @PowerKiKi! -FormattedExecutionResultinstead of
ExecutionResult
[email protected]
Major Changes
-
#2342
baf538a
Thanks @PowerKiKi! - Drop deprecated things:- Instead of
ApolloModule, use eitherprovideApollo()orprovideNamedApollo(). - Instead of
import {graphql} from 'apollo-angular';use
import {gql as graphql} from 'apollo-angular';
- Instead of
[email protected]
Patch Changes
- #2336
78b0ba1
Thanks @PowerKiKi! - Export MutationOptionsAlone,
QueryOptionsAlone, SubscriptionOptionsAlone, WatchQueryOptionsAlone from 'apollo-angular'
[email protected]
Patch Changes
-
#2333
9866ec6
Thanks @PowerKiKi! - dependencies updates:- Updated dependency
@apollo/client@^3.10.0↗︎ (from
^3.0.0, inpeerDependencies)
- Updated dependency
-
#2333
eeec0a9
Thanks @PowerKiKi! - Requires @apollo/client ^3.10.0 for
watchFragment