Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-3.11' into jerel/devtool…
Browse files Browse the repository at this point in the history
…s-name
  • Loading branch information
jerelmiller committed Jul 9, 2024
2 parents 882ff84 + 602a678 commit 7a72e3f
Show file tree
Hide file tree
Showing 13 changed files with 387 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .api-reports/api-report-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ export interface BaseQueryOptions<TVariables extends OperationVariables = Operat
export interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVariables = OperationVariables> {
client?: ApolloClient<object>;
context?: Context;
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
errorPolicy?: ErrorPolicy;
// 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 @@ -1006,7 +1008,6 @@ export interface LoadableQueryHookOptions {
canonizeResults?: boolean;
client?: ApolloClient<any>;
context?: Context;
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
errorPolicy?: ErrorPolicy;
fetchPolicy?: LoadableQueryHookFetchPolicy;
queryKey?: string | number | any[];
Expand Down
3 changes: 2 additions & 1 deletion .api-reports/api-report-react_components.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ interface BaseQueryOptions<TVariables extends OperationVariables = OperationVari
interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVariables = OperationVariables> {
client?: ApolloClient<object>;
context?: DefaultContext;
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
errorPolicy?: ErrorPolicy;
// 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 @@ -994,7 +996,6 @@ export interface Mutation<TData, TVariables> {
interface MutationBaseOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> {
awaitRefetchQueries?: boolean;
context?: TContext;
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
errorPolicy?: ErrorPolicy;
// Warning: (ae-forgotten-export) The symbol "OnQueryUpdated" needs to be exported by the entry point index.d.ts
onQueryUpdated?: OnQueryUpdated<any>;
Expand Down
3 changes: 2 additions & 1 deletion .api-reports/api-report-react_hooks.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ interface BaseQueryOptions<TVariables extends OperationVariables = OperationVari
interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVariables = OperationVariables> {
client?: ApolloClient<object>;
context?: DefaultContext;
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
errorPolicy?: ErrorPolicy;
// 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 @@ -954,7 +956,6 @@ interface LoadableQueryHookOptions {
canonizeResults?: boolean;
client?: ApolloClient<any>;
context?: DefaultContext;
// Warning: (ae-forgotten-export) The symbol "ErrorPolicy" needs to be exported by the entry point index.d.ts
errorPolicy?: ErrorPolicy;
// Warning: (ae-forgotten-export) The symbol "LoadableQueryHookFetchPolicy" needs to be exported by the entry point index.d.ts
fetchPolicy?: LoadableQueryHookFetchPolicy;
Expand Down
72 changes: 71 additions & 1 deletion .api-reports/api-report-react_internal.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@ class Concast<T> extends Observable<T> {
// @public (undocumented)
type ConcastSourcesIterable<T> = Iterable<Source<T>>;

// Warning: (ae-forgotten-export) The symbol "PreloadQueryFunction" needs to be exported by the entry point index.d.ts
//
// @public
function createQueryPreloader(client: ApolloClient<any>): PreloadQueryFunction;

// @public (undocumented)
namespace DataProxy {
// (undocumented)
Expand Down Expand Up @@ -1264,6 +1269,11 @@ const OBSERVED_CHANGED_OPTIONS: readonly ["canonizeResults", "context", "errorPo
// @public (undocumented)
type ObservedOptions = Pick<WatchQueryOptions, (typeof OBSERVED_CHANGED_OPTIONS)[number]>;

// @public
type OnlyRequiredProperties<T> = {
[K in keyof T as {} extends Pick<T, K> ? never : K]: T[K];
};

// @public (undocumented)
type OnQueryUpdated<TResult> = (observableQuery: ObservableQuery<any>, diff: Cache_2.DiffResult<any>, lastDiff: Cache_2.DiffResult<any> | undefined) => boolean | TResult;

Expand Down Expand Up @@ -1303,6 +1313,50 @@ export interface PreloadedQueryRef<TData = unknown, TVariables = unknown> extend
toPromise(): Promise<PreloadedQueryRef<TData, TVariables>>;
}

// @public (undocumented)
type PreloadQueryFetchPolicy = Extract<WatchQueryFetchPolicy, "cache-first" | "network-only" | "no-cache" | "cache-and-network">;

// @public
interface PreloadQueryFunction {
// Warning: (ae-forgotten-export) The symbol "PreloadQueryOptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "PreloadQueryOptionsArg" needs to be exported by the entry point index.d.ts
<TData, TVariables extends OperationVariables, TOptions extends Omit<PreloadQueryOptions, "variables">>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: PreloadQueryOptionsArg<NoInfer_2<TVariables>, TOptions>): PreloadedQueryRef<TOptions["errorPolicy"] extends "ignore" | "all" ? TOptions["returnPartialData"] extends true ? DeepPartial<TData> | undefined : TData | undefined : TOptions["returnPartialData"] extends true ? DeepPartial<TData> : TData, TVariables>;
<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: PreloadQueryOptions<NoInfer_2<TVariables>> & {
returnPartialData: true;
errorPolicy: "ignore" | "all";
}): PreloadedQueryRef<DeepPartial<TData> | undefined, TVariables>;
<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: PreloadQueryOptions<NoInfer_2<TVariables>> & {
errorPolicy: "ignore" | "all";
}): PreloadedQueryRef<TData | undefined, TVariables>;
<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options: PreloadQueryOptions<NoInfer_2<TVariables>> & {
returnPartialData: true;
}): PreloadedQueryRef<DeepPartial<TData>, TVariables>;
<TData = unknown, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, ...[options]: PreloadQueryOptionsArg<NoInfer_2<TVariables>>): PreloadedQueryRef<TData, TVariables>;
}

// Warning: (ae-forgotten-export) The symbol "VariablesOption" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type PreloadQueryOptions<TVariables extends OperationVariables = OperationVariables> = {
canonizeResults?: boolean;
context?: DefaultContext;
errorPolicy?: ErrorPolicy;
fetchPolicy?: PreloadQueryFetchPolicy;
returnPartialData?: boolean;
refetchWritePolicy?: RefetchWritePolicy;
} & VariablesOption<TVariables>;

// Warning: (ae-forgotten-export) The symbol "OnlyRequiredProperties" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type PreloadQueryOptionsArg<TVariables extends OperationVariables, TOptions = unknown> = [TVariables] extends [never] ? [
options?: PreloadQueryOptions<never> & TOptions
] : {} extends OnlyRequiredProperties<TVariables> ? [
options?: PreloadQueryOptions<NoInfer_2<TVariables>> & Omit<TOptions, "variables">
] : [
options: PreloadQueryOptions<NoInfer_2<TVariables>> & Omit<TOptions, "variables">
];

// @public (undocumented)
type Primitive = null | undefined | string | number | boolean | symbol | bigint;

Expand Down Expand Up @@ -1704,7 +1758,6 @@ interface SharedWatchQueryOptions<TVariables extends OperationVariables, TData>
// @deprecated
partialRefetch?: boolean;
pollInterval?: number;
// Warning: (ae-forgotten-export) The symbol "RefetchWritePolicy" needs to be exported by the entry point index.d.ts
refetchWritePolicy?: RefetchWritePolicy;
returnPartialData?: boolean;
skipPollAttempt?: () => boolean;
Expand Down Expand Up @@ -2061,6 +2114,17 @@ interface UseSuspenseQueryResult<TData = unknown, TVariables extends OperationVa
subscribeToMore: SubscribeToMoreFunction<TData, TVariables>;
}

// @public (undocumented)
type VariablesOption<TVariables extends OperationVariables> = [
TVariables
] extends [never] ? {
variables?: Record<string, never>;
} : {} extends OnlyRequiredProperties<TVariables> ? {
variables?: TVariables;
} : {
variables: TVariables;
};

// @public
interface WatchFragmentOptions<TData, TVars> {
// @deprecated (undocumented)
Expand Down Expand Up @@ -2093,6 +2157,10 @@ interface WatchQueryOptions<TVariables extends OperationVariables = OperationVar

// @public (undocumented)
interface WrappableHooks {
// Warning: (ae-forgotten-export) The symbol "createQueryPreloader" needs to be exported by the entry point index.d.ts
//
// (undocumented)
createQueryPreloader: typeof createQueryPreloader;
// Warning: (ae-forgotten-export) The symbol "useBackgroundQuery" needs to be exported by the entry point index.d.ts
//
// (undocumented)
Expand Down Expand Up @@ -2153,6 +2221,8 @@ export function wrapQueryRef<TData, TVariables extends OperationVariables>(inter
// 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
// src/react/query-preloader/createQueryPreloader.ts:145:3 - (ae-forgotten-export) The symbol "PreloadQueryFetchPolicy" needs to be exported by the entry point index.d.ts
// src/react/query-preloader/createQueryPreloader.ts:167:5 - (ae-forgotten-export) The symbol "RefetchWritePolicy" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
1 change: 1 addition & 0 deletions .api-reports/api-report.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ export interface BaseQueryOptions<TVariables extends OperationVariables = Operat
export interface BaseSubscriptionOptions<TData = any, TVariables extends OperationVariables = OperationVariables> {
client?: ApolloClient<object>;
context?: DefaultContext;
errorPolicy?: ErrorPolicy;
fetchPolicy?: FetchPolicy;
ignoreResults?: boolean;
onComplete?: () => void;
Expand Down
5 changes: 5 additions & 0 deletions .changeset/thin-lies-begin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@apollo/client": patch
---

Allow wrapping `createQueryPreloader`
4 changes: 2 additions & 2 deletions .size-limits.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"dist/apollo-client.min.cjs": 40048,
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32950
"dist/apollo-client.min.cjs": 40110,
"import { ApolloClient, InMemoryCache, HttpLink } from \"dist/index.js\" (production)": 32941
}
Loading

0 comments on commit 7a72e3f

Please sign in to comment.