Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/platform-server": "^18.0.0",
"@angular/router": "^18.0.0",
"@apollo/client": "^3.10.4",
"@apollo/client": "^3.13.0",
"@babel/core": "^7.24.6",
"@babel/preset-env": "^7.24.6",
"@changesets/changelog-github": "^0.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/apollo-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"peerDependencies": {
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0",
"@apollo/client": "^3.10.0",
"@apollo/client": "^3.13.0",
"graphql": "^15.0.0 || ^16.0.0",
"rxjs": "^6.0.0 || ^7.0.0"
},
Expand Down
7 changes: 5 additions & 2 deletions packages/apollo-angular/src/query-ref.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import type {
OperationVariables,
SubscribeToMoreOptions,
TypedDocumentNode,
Unmasked,
UpdateQueryOptions,
} from '@apollo/client/core';
import { NetworkStatus } from '@apollo/client/core';
Expand Down Expand Up @@ -103,15 +104,17 @@ export class QueryRef<T, V extends OperationVariables = EmptyObject> {
return this.obsQuery.fetchMore(fetchMoreOptions);
}

public subscribeToMore<MT = any, MV = EmptyObject>(
public subscribeToMore<MT = any, MV extends OperationVariables = EmptyObject>(
options: SubscribeToMoreOptions<T, MV, MT>,
): () => void {
// XXX: there's a bug in apollo-client typings
// it should not inherit types from ObservableQuery
return this.obsQuery.subscribeToMore(options as any);
}

public updateQuery(mapFn: (previousQueryResult: T, options: UpdateQueryOptions<V>) => T): void {
public updateQuery(
mapFn: (previousQueryResult: Unmasked<T>, options: UpdateQueryOptions<T, V>) => Unmasked<T>,
): void {
return this.obsQuery.updateQuery(mapFn);
}

Expand Down
13 changes: 4 additions & 9 deletions packages/apollo-angular/src/subscription.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import type { DocumentNode } from 'graphql';
import type { Observable } from 'rxjs';
import { Injectable } from '@angular/core';
import type { OperationVariables, TypedDocumentNode } from '@apollo/client/core';
import type { FetchResult, OperationVariables, TypedDocumentNode } from '@apollo/client/core';
import { Apollo } from './apollo';
import {
EmptyObject,
ExtraSubscriptionOptions,
SubscriptionOptionsAlone,
SubscriptionResult,
} from './types';
import { EmptyObject, ExtraSubscriptionOptions, SubscriptionOptionsAlone } from './types';

@Injectable()
export abstract class Subscription<T = any, V extends OperationVariables = EmptyObject> {
Expand All @@ -21,8 +16,8 @@ export abstract class Subscription<T = any, V extends OperationVariables = Empty
variables?: V,
options?: SubscriptionOptionsAlone<V, T>,
extra?: ExtraSubscriptionOptions,
): Observable<SubscriptionResult<T>> {
return this.apollo.use(this.client).subscribe<T, V>(
): Observable<FetchResult<T>> {
return this.apollo.use(this.client).subscribe(
{
...options,
variables,
Expand Down
36 changes: 23 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@
dependencies:
tslib "^2.3.0"

"@apollo/client@^3.10.4":
version "3.10.8"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.10.8.tgz#96b1548818e45fac752ec2bd318e5466d9ca26b5"
integrity sha512-UaaFEitRrPRWV836wY2L7bd3HRCfbMie1jlYMcmazFAK23MVhz/Uq7VG1nwbotPb5xzFsw5RF4Wnp2G3dWPM3g==
"@apollo/client@^3.13.0":
version "3.13.0"
resolved "https://registry.yarnpkg.com/@apollo/client/-/client-3.13.0.tgz#a9c310a77a0460512daef03a47b6b92e85f1a631"
integrity sha512-sCrdGw6Jv+0csdy5YwnAJ231CJWvJOBsHB3mZWdI+jA62lsJcV2TYWSaIYd7Cno3Apk8JBDbEGrMEKALeQUmOQ==
dependencies:
"@graphql-typed-document-node/core" "^3.1.1"
"@wry/caches" "^1.0.0"
Expand All @@ -265,7 +265,6 @@
optimism "^0.18.0"
prop-types "^15.7.2"
rehackt "^0.1.0"
response-iterator "^0.2.6"
symbol-observable "^4.0.0"
ts-invariant "^0.10.3"
tslib "^2.3.0"
Expand Down Expand Up @@ -10677,11 +10676,6 @@ [email protected], resolve@^1.1.6, resolve@^1.1.7, resolve@^1.12.0, resolve@^1.14.2
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"

response-iterator@^0.2.6:
version "0.2.6"
resolved "https://registry.yarnpkg.com/response-iterator/-/response-iterator-0.2.6.tgz#249005fb14d2e4eeb478a3f735a28fd8b4c9f3da"
integrity sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==

restore-cursor@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e"
Expand Down Expand Up @@ -11351,7 +11345,16 @@ string-length@^4.0.1:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -11393,7 +11396,14 @@ stringify-entities@^4.0.0:
character-entities-html4 "^2.0.0"
character-entities-legacy "^3.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -12454,7 +12464,7 @@ wildcard@^2.0.0:
resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67"
integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down
Loading