Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into jerel/issue-9448-lazy…
Browse files Browse the repository at this point in the history
…-query-double-call
  • Loading branch information
jerelmiller committed Feb 6, 2024
2 parents 79c3d8a + 4c51731 commit 7dced46
Show file tree
Hide file tree
Showing 15 changed files with 407 additions and 200 deletions.
16 changes: 8 additions & 8 deletions .api-reports/api-report-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -1368,19 +1368,19 @@ class ObservableQuery<TData = any, TVariables extends OperationVariables = Opera

// @public (undocumented)
export interface ObservableQueryFields<TData, TVariables extends OperationVariables> {
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
updateQuery?: (previousQueryResult: TData, options: {
fetchMoreResult: TFetchData;
variables: TFetchVars;
}) => TData;
}): Promise<ApolloQueryResult<TFetchData>>;
refetch(variables?: Partial<TVariables>): Promise<ApolloQueryResult<TData>>;
}) => Promise<ApolloQueryResult<TFetchData>>;
refetch: (variables?: Partial<TVariables>) => Promise<ApolloQueryResult<TData>>;
// @internal (undocumented)
reobserve(newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus): Promise<ApolloQueryResult<TData>>;
startPolling(pollInterval: number): void;
stopPolling(): void;
subscribeToMore<TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>): () => void;
updateQuery<TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData): void;
reobserve: (newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus) => Promise<ApolloQueryResult<TData>>;
startPolling: (pollInterval: number) => void;
stopPolling: () => void;
subscribeToMore: <TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>) => () => void;
updateQuery: <TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData) => void;
variables: TVariables | undefined;
}

Expand Down
16 changes: 8 additions & 8 deletions .api-reports/api-report-react_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -1144,19 +1144,19 @@ class ObservableQuery<TData = any, TVariables extends OperationVariables = Opera

// @public (undocumented)
interface ObservableQueryFields<TData, TVariables extends OperationVariables> {
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
updateQuery?: (previousQueryResult: TData, options: {
fetchMoreResult: TFetchData;
variables: TFetchVars;
}) => TData;
}): Promise<ApolloQueryResult<TFetchData>>;
refetch(variables?: Partial<TVariables>): Promise<ApolloQueryResult<TData>>;
}) => Promise<ApolloQueryResult<TFetchData>>;
refetch: (variables?: Partial<TVariables>) => Promise<ApolloQueryResult<TData>>;
// @internal (undocumented)
reobserve(newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus): Promise<ApolloQueryResult<TData>>;
startPolling(pollInterval: number): void;
stopPolling(): void;
subscribeToMore<TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>): () => void;
updateQuery<TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData): void;
reobserve: (newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus) => Promise<ApolloQueryResult<TData>>;
startPolling: (pollInterval: number) => void;
stopPolling: () => void;
subscribeToMore: <TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>) => () => void;
updateQuery: <TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData) => void;
variables: TVariables | undefined;
}

Expand Down
16 changes: 8 additions & 8 deletions .api-reports/api-report-react_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -1101,19 +1101,19 @@ class ObservableQuery<TData = any, TVariables extends OperationVariables = Opera

// @public (undocumented)
interface ObservableQueryFields<TData, TVariables extends OperationVariables> {
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
updateQuery?: (previousQueryResult: TData, options: {
fetchMoreResult: TFetchData;
variables: TFetchVars;
}) => TData;
}): Promise<ApolloQueryResult<TFetchData>>;
refetch(variables?: Partial<TVariables>): Promise<ApolloQueryResult<TData>>;
}) => Promise<ApolloQueryResult<TFetchData>>;
refetch: (variables?: Partial<TVariables>) => Promise<ApolloQueryResult<TData>>;
// @internal (undocumented)
reobserve(newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus): Promise<ApolloQueryResult<TData>>;
startPolling(pollInterval: number): void;
stopPolling(): void;
subscribeToMore<TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>): () => void;
updateQuery<TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData): void;
reobserve: (newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus) => Promise<ApolloQueryResult<TData>>;
startPolling: (pollInterval: number) => void;
stopPolling: () => void;
subscribeToMore: <TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>) => () => void;
updateQuery: <TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData) => void;
variables: TVariables | undefined;
}

Expand Down
16 changes: 8 additions & 8 deletions .api-reports/api-report-react_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -1313,19 +1313,19 @@ class ObservableQuery<TData = any, TVariables extends OperationVariables = Opera

// @public (undocumented)
interface ObservableQueryFields<TData, TVariables extends OperationVariables> {
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
updateQuery?: (previousQueryResult: TData, options: {
fetchMoreResult: TFetchData;
variables: TFetchVars;
}) => TData;
}): Promise<ApolloQueryResult<TFetchData>>;
refetch(variables?: Partial<TVariables>): Promise<ApolloQueryResult<TData>>;
}) => Promise<ApolloQueryResult<TFetchData>>;
refetch: (variables?: Partial<TVariables>) => Promise<ApolloQueryResult<TData>>;
// @internal (undocumented)
reobserve(newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus): Promise<ApolloQueryResult<TData>>;
startPolling(pollInterval: number): void;
stopPolling(): void;
subscribeToMore<TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>): () => void;
updateQuery<TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData): void;
reobserve: (newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus) => Promise<ApolloQueryResult<TData>>;
startPolling: (pollInterval: number) => void;
stopPolling: () => void;
subscribeToMore: <TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>) => () => void;
updateQuery: <TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData) => void;
variables: TVariables | undefined;
}

Expand Down
16 changes: 8 additions & 8 deletions .api-reports/api-report-react_ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -1086,19 +1086,19 @@ class ObservableQuery<TData = any, TVariables extends OperationVariables = Opera

// @public (undocumented)
interface ObservableQueryFields<TData, TVariables extends OperationVariables> {
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
updateQuery?: (previousQueryResult: TData, options: {
fetchMoreResult: TFetchData;
variables: TFetchVars;
}) => TData;
}): Promise<ApolloQueryResult<TFetchData>>;
refetch(variables?: Partial<TVariables>): Promise<ApolloQueryResult<TData>>;
}) => Promise<ApolloQueryResult<TFetchData>>;
refetch: (variables?: Partial<TVariables>) => Promise<ApolloQueryResult<TData>>;
// @internal (undocumented)
reobserve(newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus): Promise<ApolloQueryResult<TData>>;
startPolling(pollInterval: number): void;
stopPolling(): void;
subscribeToMore<TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>): () => void;
updateQuery<TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData): void;
reobserve: (newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus) => Promise<ApolloQueryResult<TData>>;
startPolling: (pollInterval: number) => void;
stopPolling: () => void;
subscribeToMore: <TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>) => () => void;
updateQuery: <TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData) => void;
variables: TVariables | undefined;
}

Expand Down
16 changes: 8 additions & 8 deletions .api-reports/api-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -1860,19 +1860,19 @@ export class ObservableQuery<TData = any, TVariables extends OperationVariables

// @public (undocumented)
export interface ObservableQueryFields<TData, TVariables extends OperationVariables> {
fetchMore<TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
fetchMore: <TFetchData = TData, TFetchVars extends OperationVariables = TVariables>(fetchMoreOptions: FetchMoreQueryOptions<TFetchVars, TFetchData> & {
updateQuery?: (previousQueryResult: TData, options: {
fetchMoreResult: TFetchData;
variables: TFetchVars;
}) => TData;
}): Promise<ApolloQueryResult<TFetchData>>;
refetch(variables?: Partial<TVariables>): Promise<ApolloQueryResult<TData>>;
}) => Promise<ApolloQueryResult<TFetchData>>;
refetch: (variables?: Partial<TVariables>) => Promise<ApolloQueryResult<TData>>;
// @internal (undocumented)
reobserve(newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus): Promise<ApolloQueryResult<TData>>;
startPolling(pollInterval: number): void;
stopPolling(): void;
subscribeToMore<TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>): () => void;
updateQuery<TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData): void;
reobserve: (newOptions?: Partial<WatchQueryOptions<TVariables, TData>>, newNetworkStatus?: NetworkStatus) => Promise<ApolloQueryResult<TData>>;
startPolling: (pollInterval: number) => void;
stopPolling: () => void;
subscribeToMore: <TSubscriptionData = TData, TSubscriptionVariables extends OperationVariables = TVariables>(options: SubscribeToMoreOptions<TData, TSubscriptionVariables, TSubscriptionData>) => () => void;
updateQuery: <TVars extends OperationVariables = TVariables>(mapFn: (previousQueryResult: TData, options: Pick<WatchQueryOptions<TVars, TData>, "variables">) => TData) => void;
variables: TVariables | undefined;
}

Expand Down
5 changes: 5 additions & 0 deletions .changeset/forty-rice-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Fix [`unbound-method`](https://github.com/apollographql/apollo-client/issues/11554) linter error on ObservableQuery methods exposed on useQuery's QueryResult object.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
externalPackage:
type: string
docker:
- image: cimg/node:20.6.1
- image: cimg/node:21.6.1
steps:
- checkout
- attach_workspace:
Expand Down
7 changes: 4 additions & 3 deletions config/processInvariants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ function transform(code: string, relativeFilePath: string) {
});

if (
!["utilities/globals/index.js", "config/jest/setup.js"].includes(
relativeFilePath
)
![
osPathJoin("utilities", "globals", "index.js"),
osPathJoin("config", "jest", "setup.js"),
].includes(relativeFilePath)
)
recast.visit(ast, {
visitIdentifier(path) {
Expand Down
Loading

0 comments on commit 7dced46

Please sign in to comment.