Skip to content

Commit

Permalink
Propose alternate types
Browse files Browse the repository at this point in the history
  • Loading branch information
samchungy committed Nov 19, 2024
1 parent 6496b25 commit e91aeaf
Show file tree
Hide file tree
Showing 33 changed files with 117 additions and 117 deletions.
10 changes: 5 additions & 5 deletions .api-reports/api-report-core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class ApolloClient<TCacheShape> implements DataProxy {
getResolvers(): Resolvers;
// (undocumented)
link: ApolloLink;
mutate<TData = any, TVariables extends OperationVariables = OperationVariables, TContext extends Record<string, any> = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>>(options: MutationOptions<TData, TVariables, TContext>): Promise<FetchResult<TData>>;
mutate<TData = any, TVariables extends OperationVariables = OperationVariables, TContext extends Record<string, any> = Partial<DefaultContext>, TCache extends ApolloCache<any> = ApolloCache<any>>(options: MutationOptions<TData, TVariables, TContext>): Promise<FetchResult<TData>>;
onClearStore(cb: () => Promise<any>): () => void;
onResetStore(cb: () => Promise<any>): () => void;
query<T = any, TVariables extends OperationVariables = OperationVariables>(options: QueryOptions<TVariables, T>): Promise<ApolloQueryResult<T>>;
Expand Down Expand Up @@ -1386,7 +1386,7 @@ type Modifiers<T extends Record<string, any> = Record<string, unknown>> = Partia
}>;

// @public (undocumented)
interface MutationBaseOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> {
interface MutationBaseOptions<TData = any, TVariables = OperationVariables, TContext = Partial<DefaultContext>, TCache extends ApolloCache<any> = ApolloCache<any>> {
awaitRefetchQueries?: boolean;
context?: TContext;
errorPolicy?: ErrorPolicy;
Expand All @@ -1407,7 +1407,7 @@ export type MutationFetchPolicy = Extract<FetchPolicy, "network-only" | "no-cach
// Warning: (ae-forgotten-export) The symbol "MutationSharedOptions" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export interface MutationOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {
export interface MutationOptions<TData = any, TVariables = OperationVariables, TContext = Partial<DefaultContext>, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {
mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
}

Expand All @@ -1428,7 +1428,7 @@ export type MutationQueryReducersMap<T = {
// Warning: (ae-forgotten-export) The symbol "MutationBaseOptions" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
interface MutationSharedOptions<TData = any, TVariables = OperationVariables, TContext = DefaultContext, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {
interface MutationSharedOptions<TData = any, TVariables = OperationVariables, TContext = Partial<DefaultContext>, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {
fetchPolicy?: MutationFetchPolicy;
keepRootFields?: boolean;
}
Expand Down Expand Up @@ -2102,7 +2102,7 @@ interface SharedWatchQueryOptions<TVariables extends OperationVariables, TData>
}

// @public (undocumented)
export interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
export interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-errors.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ type ServerParseError = Error & {
// Warning: (ae-forgotten-export) The symbol "DefaultContext" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_batch-http.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ interface Printer {
type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_batch.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ type Path = ReadonlyArray<string | number>;
type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
4 changes: 2 additions & 2 deletions .api-reports/api-report-link_context.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ApolloLink {
// Warning: (ae-forgotten-export) The symbol "DefaultContext" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export type ContextSetter = (operation: GraphQLRequest, prevContext: DefaultContext) => Promise<DefaultContext> | DefaultContext;
export type ContextSetter = (operation: GraphQLRequest, prevContext: DefaultContext) => Promise<Partial<DefaultContext>> | Partial<DefaultContext>;

// @public (undocumented)
interface DefaultContext extends Record<string, any> {
Expand Down Expand Up @@ -168,7 +168,7 @@ type RequestHandler = (operation: Operation, forward: NextLink) => Observable<Fe
export function setContext(setter: ContextSetter): ApolloLink;

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_core.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export type Path = ReadonlyArray<string | number>;
export type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;

// @public (undocumented)
export interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
export interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_error.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ type ServerParseError = Error & {
};

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_http.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export type ServerParseError = Error & {
};

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_persisted-queries.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ type ServerParseError = Error & {
type SHA256Function = (...args: any[]) => string | PromiseLike<string>;

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_remove-typename.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export interface RemoveTypenameFromVariablesOptions {
type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_retry.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export class RetryLink extends ApolloLink {
}

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_schema.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export class SchemaLink extends ApolloLink {
}

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_subscriptions.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ type Path = ReadonlyArray<string | number>;
type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
2 changes: 1 addition & 1 deletion .api-reports/api-report-link_ws.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ type Path = ReadonlyArray<string | number>;
type RequestHandler = (operation: Operation, forward: NextLink) => Observable<FetchResult> | null;

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = DefaultContext, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<DefaultContext>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down
24 changes: 12 additions & 12 deletions .api-reports/api-report-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class ApolloClient<TCacheShape> implements DataProxy {
link: ApolloLink;
// Warning: (ae-forgotten-export) The symbol "MutationOptions" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "FetchResult" needs to be exported by the entry point index.d.ts
mutate<TData = any, TVariables extends OperationVariables = OperationVariables, TContext extends Record<string, any> = Context, TCache extends ApolloCache<any> = ApolloCache<any>>(options: MutationOptions<TData, TVariables, TContext>): Promise<FetchResult<TData>>;
mutate<TData = any, TVariables extends OperationVariables = OperationVariables, TContext extends Record<string, any> = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>>(options: MutationOptions<TData, TVariables, TContext>): Promise<FetchResult<TData>>;
onClearStore(cb: () => Promise<any>): () => void;
onResetStore(cb: () => Promise<any>): () => void;
// Warning: (ae-forgotten-export) The symbol "QueryOptions" needs to be exported by the entry point index.d.ts
Expand Down Expand Up @@ -369,7 +369,7 @@ type BackgroundQueryHookOptionsNoInfer<TData, TVariables extends OperationVariab
// Warning: (ae-forgotten-export) The symbol "MutationSharedOptions" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
export interface BaseMutationOptions<TData = any, TVariables = OperationVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {
export interface BaseMutationOptions<TData = any, TVariables = OperationVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {
client?: ApolloClient<object>;
ignoreResults?: boolean;
notifyOnNetworkStatusChange?: boolean;
Expand Down Expand Up @@ -1113,7 +1113,7 @@ type Modifiers<T extends Record<string, any> = Record<string, unknown>> = Partia
}>;

// @public (undocumented)
interface MutationBaseOptions<TData = any, TVariables = OperationVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>> {
interface MutationBaseOptions<TData = any, TVariables = OperationVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>> {
awaitRefetchQueries?: boolean;
context?: TContext;
errorPolicy?: ErrorPolicy;
Expand All @@ -1132,7 +1132,7 @@ interface MutationBaseOptions<TData = any, TVariables = OperationVariables, TCon
}

// @public (undocumented)
export interface MutationDataOptions<TData = any, TVariables = OperationVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
export interface MutationDataOptions<TData = any, TVariables = OperationVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
// (undocumented)
mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
}
Expand All @@ -1141,19 +1141,19 @@ export interface MutationDataOptions<TData = any, TVariables = OperationVariable
type MutationFetchPolicy = Extract<FetchPolicy, "network-only" | "no-cache">;

// @public (undocumented)
export type MutationFunction<TData = any, TVariables = OperationVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>> = (options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>) => Promise<FetchResult<TData>>;
export type MutationFunction<TData = any, TVariables = OperationVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>> = (options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>) => Promise<FetchResult<TData>>;

// @public (undocumented)
export interface MutationFunctionOptions<TData = any, TVariables = OperationVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
export interface MutationFunctionOptions<TData = any, TVariables = OperationVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
mutation?: DocumentNode | TypedDocumentNode<TData, TVariables>;
}

// @public (undocumented)
export interface MutationHookOptions<TData = any, TVariables = OperationVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
export interface MutationHookOptions<TData = any, TVariables = OperationVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>> extends BaseMutationOptions<TData, TVariables, TContext, TCache> {
}

// @public (undocumented)
interface MutationOptions<TData = any, TVariables = OperationVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {
interface MutationOptions<TData = any, TVariables = OperationVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationSharedOptions<TData, TVariables, TContext, TCache> {
mutation: DocumentNode | TypedDocumentNode<TData, TVariables>;
}

Expand Down Expand Up @@ -1184,7 +1184,7 @@ export interface MutationResult<TData = any> {
// Warning: (ae-forgotten-export) The symbol "MutationBaseOptions" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
interface MutationSharedOptions<TData = any, TVariables = OperationVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {
interface MutationSharedOptions<TData = any, TVariables = OperationVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>> extends MutationBaseOptions<TData, TVariables, TContext, TCache> {
// Warning: (ae-forgotten-export) The symbol "MutationFetchPolicy" needs to be exported by the entry point index.d.ts
fetchPolicy?: MutationFetchPolicy;
keepRootFields?: boolean;
Expand All @@ -1203,7 +1203,7 @@ interface MutationStoreValue {
}

// @public (undocumented)
export type MutationTuple<TData, TVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>> = [
export type MutationTuple<TData, TVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>> = [
mutate: (options?: MutationFunctionOptions<TData, TVariables, TContext, TCache>) => Promise<FetchResult<TData>>,
result: MutationResult<TData>
];
Expand Down Expand Up @@ -1894,7 +1894,7 @@ interface SharedWatchQueryOptions<TVariables extends OperationVariables, TData>
}

// @public (undocumented)
interface SingleExecutionResult<TData = Record<string, any>, TContext = Context, TExtensions = Record<string, any>> {
interface SingleExecutionResult<TData = Record<string, any>, TContext = Partial<Context>, TExtensions = Record<string, any>> {
// (undocumented)
context?: TContext;
// (undocumented)
Expand Down Expand Up @@ -2196,7 +2196,7 @@ handlers: {
];

// @public
export function useMutation<TData = any, TVariables = OperationVariables, TContext = Context, TCache extends ApolloCache<any> = ApolloCache<any>>(mutation: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: MutationHookOptions<NoInfer_2<TData>, NoInfer_2<TVariables>, TContext, TCache>): MutationTuple<TData, TVariables, TContext, TCache>;
export function useMutation<TData = any, TVariables = OperationVariables, TContext = Partial<Context>, TCache extends ApolloCache<any> = ApolloCache<any>>(mutation: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: MutationHookOptions<NoInfer_2<TData>, NoInfer_2<TVariables>, TContext, TCache>): MutationTuple<TData, TVariables, TContext, TCache>;

// @public
export function useQuery<TData = any, TVariables extends OperationVariables = OperationVariables>(query: DocumentNode | TypedDocumentNode<TData, TVariables>, options?: QueryHookOptions<NoInfer_2<TData>, NoInfer_2<TVariables>>): QueryResult<TData, TVariables>;
Expand Down
Loading

0 comments on commit e91aeaf

Please sign in to comment.