Skip to content

Commit 3812800

Browse files
Support extensions in useSubscription (#11854)
Co-authored-by: Lenz Weber-Tronic <[email protected]>
1 parent 5793301 commit 3812800

20 files changed

+209
-111
lines changed

Diff for: .api-reports/api-report-core.api.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,7 @@ class QueryManager<TStore> {
18661866
// (undocumented)
18671867
readonly ssrMode: boolean;
18681868
// (undocumented)
1869-
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
1869+
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
18701870
stop(): void;
18711871
// (undocumented)
18721872
stopQuery(queryId: string): void;
@@ -2142,6 +2142,7 @@ export type SubscribeToMoreOptions<TData = any, TSubscriptionVariables = Operati
21422142
export interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
21432143
context?: DefaultContext;
21442144
errorPolicy?: ErrorPolicy;
2145+
extensions?: Record<string, any>;
21452146
fetchPolicy?: FetchPolicy;
21462147
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
21472148
variables?: TVariables;
@@ -2302,9 +2303,9 @@ interface WriteContext extends ReadMergeModifyContext {
23022303
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
23032304
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
23042305
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
2305-
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
2306-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
2307-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
2306+
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
2307+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
2308+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
23082309
// src/link/http/selectHttpOptionsAndBody.ts:128:32 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts
23092310

23102311
// (No @packageDocumentation comment for this package)

Diff for: .api-reports/api-report-react.api.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ export interface BaseSubscriptionOptions<TData = any, TVariables extends Operati
392392
context?: Context;
393393
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
394394
errorPolicy?: ErrorPolicy;
395+
extensions?: Record<string, any>;
395396
// Warning: (ae-forgotten-export) The symbol "FetchPolicy" needs to be exported by the entry point index.d.ts
396397
fetchPolicy?: FetchPolicy;
397398
ignoreResults?: boolean;
@@ -1647,7 +1648,7 @@ class QueryManager<TStore> {
16471648
// (undocumented)
16481649
readonly ssrMode: boolean;
16491650
// (undocumented)
1650-
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
1651+
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
16511652
stop(): void;
16521653
// (undocumented)
16531654
stopQuery(queryId: string): void;
@@ -1948,6 +1949,7 @@ export interface SubscriptionHookOptions<TData = any, TVariables extends Operati
19481949
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
19491950
context?: Context;
19501951
errorPolicy?: ErrorPolicy;
1952+
extensions?: Record<string, any>;
19511953
fetchPolicy?: FetchPolicy;
19521954
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
19531955
variables?: TVariables;
@@ -2324,11 +2326,11 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
23242326
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
23252327
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
23262328
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
2327-
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
2329+
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
23282330
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
23292331
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
2330-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
2331-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
2332+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
2333+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
23322334
// src/react/hooks/useBackgroundQuery.ts:38:3 - (ae-forgotten-export) The symbol "SubscribeToMoreFunction" needs to be exported by the entry point index.d.ts
23332335
// src/react/hooks/useBackgroundQuery.ts:54:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts
23342336
// src/react/hooks/useBackgroundQuery.ts:78:4 - (ae-forgotten-export) The symbol "RefetchFunction" needs to be exported by the entry point index.d.ts

Diff for: .api-reports/api-report-react_components.api.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVaria
340340
context?: DefaultContext;
341341
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
342342
errorPolicy?: ErrorPolicy;
343+
extensions?: Record<string, any>;
343344
// Warning: (ae-forgotten-export) The symbol "FetchPolicy" needs to be exported by the entry point index.d.ts
344345
fetchPolicy?: FetchPolicy;
345346
ignoreResults?: boolean;
@@ -1461,7 +1462,7 @@ class QueryManager<TStore> {
14611462
// (undocumented)
14621463
readonly ssrMode: boolean;
14631464
// (undocumented)
1464-
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
1465+
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
14651466
stop(): void;
14661467
// (undocumented)
14671468
stopQuery(queryId: string): void;
@@ -1696,6 +1697,7 @@ export interface SubscriptionComponentOptions<TData = any, TVariables extends Op
16961697
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
16971698
context?: DefaultContext;
16981699
errorPolicy?: ErrorPolicy;
1700+
extensions?: Record<string, any>;
16991701
fetchPolicy?: FetchPolicy;
17001702
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
17011703
variables?: TVariables;
@@ -1803,11 +1805,11 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
18031805
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
18041806
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
18051807
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
1806-
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
1808+
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
18071809
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
18081810
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
1809-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
1810-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
1811+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
1812+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
18111813

18121814
// (No @packageDocumentation comment for this package)
18131815

Diff for: .api-reports/api-report-react_context.api.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ class QueryManager<TStore> {
13901390
// (undocumented)
13911391
readonly ssrMode: boolean;
13921392
// (undocumented)
1393-
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
1393+
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
13941394
stop(): void;
13951395
// (undocumented)
13961396
stopQuery(queryId: string): void;
@@ -1626,6 +1626,7 @@ type SubscribeToMoreOptions<TData = any, TSubscriptionVariables = OperationVaria
16261626
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
16271627
context?: DefaultContext;
16281628
errorPolicy?: ErrorPolicy;
1629+
extensions?: Record<string, any>;
16291630
fetchPolicy?: FetchPolicy;
16301631
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
16311632
variables?: TVariables;
@@ -1724,11 +1725,11 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
17241725
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
17251726
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
17261727
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
1727-
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
1728+
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
17281729
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
17291730
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
1730-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
1731-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
1731+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
1732+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
17321733

17331734
// (No @packageDocumentation comment for this package)
17341735

Diff for: .api-reports/api-report-react_hoc.api.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ class QueryManager<TStore> {
14351435
// (undocumented)
14361436
readonly ssrMode: boolean;
14371437
// (undocumented)
1438-
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
1438+
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
14391439
stop(): void;
14401440
// (undocumented)
14411441
stopQuery(queryId: string): void;
@@ -1632,6 +1632,7 @@ type SubscribeToMoreOptions<TData = any, TSubscriptionVariables = OperationVaria
16321632
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
16331633
context?: DefaultContext;
16341634
errorPolicy?: ErrorPolicy;
1635+
extensions?: Record<string, any>;
16351636
fetchPolicy?: FetchPolicy;
16361637
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
16371638
variables?: TVariables;
@@ -1753,11 +1754,11 @@ export function withSubscription<TProps extends TGraphQLVariables | {} = {}, TDa
17531754
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
17541755
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
17551756
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
1756-
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
1757+
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
17571758
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
17581759
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
1759-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
1760-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
1760+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
1761+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
17611762

17621763
// (No @packageDocumentation comment for this package)
17631764

Diff for: .api-reports/api-report-react_hooks.api.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVaria
363363
context?: DefaultContext;
364364
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
365365
errorPolicy?: ErrorPolicy;
366+
extensions?: Record<string, any>;
366367
// Warning: (ae-forgotten-export) The symbol "FetchPolicy" needs to be exported by the entry point index.d.ts
367368
fetchPolicy?: FetchPolicy;
368369
ignoreResults?: boolean;
@@ -1516,7 +1517,7 @@ class QueryManager<TStore> {
15161517
// (undocumented)
15171518
readonly ssrMode: boolean;
15181519
// (undocumented)
1519-
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
1520+
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
15201521
stop(): void;
15211522
// (undocumented)
15221523
stopQuery(queryId: string): void;
@@ -1770,6 +1771,7 @@ interface SubscriptionHookOptions<TData = any, TVariables extends OperationVaria
17701771
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
17711772
context?: DefaultContext;
17721773
errorPolicy?: ErrorPolicy;
1774+
extensions?: Record<string, any>;
17731775
fetchPolicy?: FetchPolicy;
17741776
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
17751777
variables?: TVariables;
@@ -2148,11 +2150,11 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
21482150
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
21492151
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
21502152
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
2151-
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
2153+
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
21522154
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
21532155
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
2154-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
2155-
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
2156+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
2157+
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
21562158
// src/react/hooks/useBackgroundQuery.ts:38:3 - (ae-forgotten-export) The symbol "SubscribeToMoreFunction" needs to be exported by the entry point index.d.ts
21572159
// src/react/hooks/useBackgroundQuery.ts:54:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts
21582160
// src/react/hooks/useBackgroundQuery.ts:78:4 - (ae-forgotten-export) The symbol "RefetchFunction" needs to be exported by the entry point index.d.ts

0 commit comments

Comments
 (0)