Skip to content

Commit

Permalink
Support extensions in useSubscription (#11854)
Browse files Browse the repository at this point in the history
Co-authored-by: Lenz Weber-Tronic <[email protected]>
  • Loading branch information
jcostello-atlassian and phryneas authored Jul 9, 2024
1 parent 5793301 commit 3812800
Show file tree
Hide file tree
Showing 20 changed files with 209 additions and 111 deletions.
9 changes: 5 additions & 4 deletions .api-reports/api-report-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1866,7 +1866,7 @@ class QueryManager<TStore> {
// (undocumented)
readonly ssrMode: boolean;
// (undocumented)
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
stop(): void;
// (undocumented)
stopQuery(queryId: string): void;
Expand Down Expand Up @@ -2142,6 +2142,7 @@ export type SubscribeToMoreOptions<TData = any, TSubscriptionVariables = Operati
export interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
context?: DefaultContext;
errorPolicy?: ErrorPolicy;
extensions?: Record<string, any>;
fetchPolicy?: FetchPolicy;
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
variables?: TVariables;
Expand Down Expand Up @@ -2302,9 +2303,9 @@ interface WriteContext extends ReadMergeModifyContext {
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/link/http/selectHttpOptionsAndBody.ts:128:32 - (ae-forgotten-export) The symbol "HttpQueryOptions" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)
Expand Down
10 changes: 6 additions & 4 deletions .api-reports/api-report-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ export interface BaseSubscriptionOptions<TData = any, TVariables extends Operati
context?: Context;
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
errorPolicy?: ErrorPolicy;
extensions?: Record<string, any>;
// Warning: (ae-forgotten-export) The symbol "FetchPolicy" needs to be exported by the entry point index.d.ts
fetchPolicy?: FetchPolicy;
ignoreResults?: boolean;
Expand Down Expand Up @@ -1647,7 +1648,7 @@ class QueryManager<TStore> {
// (undocumented)
readonly ssrMode: boolean;
// (undocumented)
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
stop(): void;
// (undocumented)
stopQuery(queryId: string): void;
Expand Down Expand Up @@ -1948,6 +1949,7 @@ export interface SubscriptionHookOptions<TData = any, TVariables extends Operati
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
context?: Context;
errorPolicy?: ErrorPolicy;
extensions?: Record<string, any>;
fetchPolicy?: FetchPolicy;
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
variables?: TVariables;
Expand Down Expand Up @@ -2324,11 +2326,11 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:38:3 - (ae-forgotten-export) The symbol "SubscribeToMoreFunction" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:54:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:78:4 - (ae-forgotten-export) The symbol "RefetchFunction" needs to be exported by the entry point index.d.ts
Expand Down
10 changes: 6 additions & 4 deletions .api-reports/api-report-react_components.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVaria
context?: DefaultContext;
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
errorPolicy?: ErrorPolicy;
extensions?: Record<string, any>;
// Warning: (ae-forgotten-export) The symbol "FetchPolicy" needs to be exported by the entry point index.d.ts
fetchPolicy?: FetchPolicy;
ignoreResults?: boolean;
Expand Down Expand Up @@ -1461,7 +1462,7 @@ class QueryManager<TStore> {
// (undocumented)
readonly ssrMode: boolean;
// (undocumented)
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
stop(): void;
// (undocumented)
stopQuery(queryId: string): void;
Expand Down Expand Up @@ -1696,6 +1697,7 @@ export interface SubscriptionComponentOptions<TData = any, TVariables extends Op
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
context?: DefaultContext;
errorPolicy?: ErrorPolicy;
extensions?: Record<string, any>;
fetchPolicy?: FetchPolicy;
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
variables?: TVariables;
Expand Down Expand Up @@ -1803,11 +1805,11 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
9 changes: 5 additions & 4 deletions .api-reports/api-report-react_context.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ class QueryManager<TStore> {
// (undocumented)
readonly ssrMode: boolean;
// (undocumented)
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
stop(): void;
// (undocumented)
stopQuery(queryId: string): void;
Expand Down Expand Up @@ -1626,6 +1626,7 @@ type SubscribeToMoreOptions<TData = any, TSubscriptionVariables = OperationVaria
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
context?: DefaultContext;
errorPolicy?: ErrorPolicy;
extensions?: Record<string, any>;
fetchPolicy?: FetchPolicy;
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
variables?: TVariables;
Expand Down Expand Up @@ -1724,11 +1725,11 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
9 changes: 5 additions & 4 deletions .api-reports/api-report-react_hoc.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1435,7 +1435,7 @@ class QueryManager<TStore> {
// (undocumented)
readonly ssrMode: boolean;
// (undocumented)
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
stop(): void;
// (undocumented)
stopQuery(queryId: string): void;
Expand Down Expand Up @@ -1632,6 +1632,7 @@ type SubscribeToMoreOptions<TData = any, TSubscriptionVariables = OperationVaria
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
context?: DefaultContext;
errorPolicy?: ErrorPolicy;
extensions?: Record<string, any>;
fetchPolicy?: FetchPolicy;
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
variables?: TVariables;
Expand Down Expand Up @@ -1753,11 +1754,11 @@ export function withSubscription<TProps extends TGraphQLVariables | {} = {}, TDa
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
10 changes: 6 additions & 4 deletions .api-reports/api-report-react_hooks.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVaria
context?: DefaultContext;
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
errorPolicy?: ErrorPolicy;
extensions?: Record<string, any>;
// Warning: (ae-forgotten-export) The symbol "FetchPolicy" needs to be exported by the entry point index.d.ts
fetchPolicy?: FetchPolicy;
ignoreResults?: boolean;
Expand Down Expand Up @@ -1516,7 +1517,7 @@ class QueryManager<TStore> {
// (undocumented)
readonly ssrMode: boolean;
// (undocumented)
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, }: SubscriptionOptions): Observable<FetchResult<T>>;
startGraphQLSubscription<T = any>({ query, fetchPolicy, errorPolicy, variables, context, extensions, }: SubscriptionOptions): Observable<FetchResult<T>>;
stop(): void;
// (undocumented)
stopQuery(queryId: string): void;
Expand Down Expand Up @@ -1770,6 +1771,7 @@ interface SubscriptionHookOptions<TData = any, TVariables extends OperationVaria
interface SubscriptionOptions<TVariables = OperationVariables, TData = any> {
context?: DefaultContext;
errorPolicy?: ErrorPolicy;
extensions?: Record<string, any>;
fetchPolicy?: FetchPolicy;
query: DocumentNode | TypedDocumentNode<TData, TVariables>;
variables?: TVariables;
Expand Down Expand Up @@ -2148,11 +2150,11 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar
// src/core/ObservableQuery.ts:117:5 - (ae-forgotten-export) The symbol "QueryInfo" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:124:5 - (ae-forgotten-export) The symbol "MutationStoreValue" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:158:5 - (ae-forgotten-export) The symbol "LocalState" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:390:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/QueryManager.ts:391:7 - (ae-forgotten-export) The symbol "UpdateQueries" needs to be exported by the entry point index.d.ts
// src/core/types.ts:174:3 - (ae-forgotten-export) The symbol "MutationQueryReducer" needs to be exported by the entry point index.d.ts
// src/core/types.ts:203:5 - (ae-forgotten-export) The symbol "Resolver" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:269:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "IgnoreModifier" needs to be exported by the entry point index.d.ts
// src/core/watchQueryOptions.ts:272:2 - (ae-forgotten-export) The symbol "UpdateQueryFn" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:38:3 - (ae-forgotten-export) The symbol "SubscribeToMoreFunction" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:54:3 - (ae-forgotten-export) The symbol "FetchMoreFunction" needs to be exported by the entry point index.d.ts
// src/react/hooks/useBackgroundQuery.ts:78:4 - (ae-forgotten-export) The symbol "RefetchFunction" needs to be exported by the entry point index.d.ts
Expand Down
Loading

0 comments on commit 3812800

Please sign in to comment.