diff --git a/node_modules/apollo-client/ApolloClient.d.ts b/node_modules/apollo-client/ApolloClient.d.ts index 33fc2ee..1bab35b 100644 --- a/node_modules/apollo-client/ApolloClient.d.ts +++ b/node_modules/apollo-client/ApolloClient.d.ts @@ -44,12 +44,12 @@ export default class ApolloClient implements DataProxy { private localState; constructor(options: ApolloClientOptions); stop(): void; - watchQuery(options: WatchQueryOptions): ObservableQuery; - query(options: QueryOptions): Promise>; + watchQuery(options: WatchQueryOptions): ObservableQuery; + query(options: QueryOptions): Promise>; mutate(options: MutationOptions): Promise>; - subscribe(options: SubscriptionOptions): Observable>; - readQuery(options: DataProxy.Query, optimistic?: boolean): T | null; - readFragment(options: DataProxy.Fragment, optimistic?: boolean): T | null; + subscribe(options: SubscriptionOptions): Observable>; + readQuery(options: DataProxy.Query, optimistic?: boolean): T | null; + readFragment(options: DataProxy.Fragment, optimistic?: boolean): T | null; writeQuery(options: DataProxy.WriteQueryOptions): void; writeFragment(options: DataProxy.WriteFragmentOptions): void; writeData(options: DataProxy.WriteDataOptions): void; diff --git a/node_modules/apollo-client/core/ObservableQuery.d.ts b/node_modules/apollo-client/core/ObservableQuery.d.ts index c2e01f4..715e842 100644 --- a/node_modules/apollo-client/core/ObservableQuery.d.ts +++ b/node_modules/apollo-client/core/ObservableQuery.d.ts @@ -34,7 +34,7 @@ export interface UpdateQueryOptions { } export declare const hasError: (storeValue: QueryStoreValue, policy?: ErrorPolicy) => boolean | Error; export declare class ObservableQuery extends Observable> { - options: WatchQueryOptions; + options: WatchQueryOptions; readonly queryId: string; readonly queryName?: string; variables: TVariables; @@ -60,7 +60,7 @@ export declare class ObservableQuery>; - fetchMore(fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions): Promise>; + fetchMore(fetchMoreOptions: FetchMoreQueryOptions & FetchMoreOptions): Promise>; subscribeToMore(options: SubscribeToMoreOptions): () => void; setOptions(opts: WatchQueryOptions): Promise | void>; setVariables(variables: TVariables, tryFetch?: boolean, fetchResults?: boolean): Promise | void>; diff --git a/node_modules/apollo-client/core/QueryManager.d.ts b/node_modules/apollo-client/core/QueryManager.d.ts index ca23f6a..4ca9d03 100644 --- a/node_modules/apollo-client/core/QueryManager.d.ts +++ b/node_modules/apollo-client/core/QueryManager.d.ts @@ -9,6 +9,8 @@ import { QueryOptions, WatchQueryOptions, SubscriptionOptions, MutationOptions } import { ObservableQuery } from './ObservableQuery'; import { QueryListener, ApolloQueryResult, FetchType, OperationVariables } from './types'; import { LocalState } from './LocalState'; +import { TypedDocumentNode } from '@graphql-typed-document-node/core'; + export interface QueryInfo { listeners: Set; invalidated: boolean; @@ -45,7 +47,7 @@ export declare class QueryManager { }); stop(): void; mutate({ mutation, variables, optimisticResponse, updateQueries: updateQueriesByName, refetchQueries, awaitRefetchQueries, update: updateWithProxyFn, errorPolicy, fetchPolicy, context, }: MutationOptions): Promise>; - fetchQuery(queryId: string, options: WatchQueryOptions, fetchType?: FetchType, fetchMoreForQueryId?: string): Promise>; + fetchQuery(queryId: string, options: WatchQueryOptions, fetchType?: FetchType, fetchMoreForQueryId?: string): Promise>; private markQueryResult; queryListenerForObserver(queryId: string, options: WatchQueryOptions, observer: Observer>): QueryListener; private transformCache; @@ -58,8 +60,8 @@ export declare class QueryManager { defaultVars: Readonly; }>; private getVariables; - watchQuery(options: WatchQueryOptions, shouldSubscribe?: boolean): ObservableQuery; - query(options: QueryOptions): Promise>; + watchQuery(options: WatchQueryOptions, shouldSubscribe?: boolean): ObservableQuery; + query(options: QueryOptions): Promise>; generateQueryId(): string; stopQueryInStore(queryId: string): void; private stopQueryInStoreNoBroadcast; @@ -83,7 +85,7 @@ export declare class QueryManager { getQueryWithPreviousResult(queryIdOrObservable: string | ObservableQuery): { previousResult: any; variables: TVariables | undefined; - document: DocumentNode; + document: DocumentNode | TypedDocumentNode; }; broadcastQueries(): void; getLocalState(): LocalState; diff --git a/node_modules/apollo-client/core/watchQueryOptions.d.ts b/node_modules/apollo-client/core/watchQueryOptions.d.ts index 2e702c6..2aae618 100644 --- a/node_modules/apollo-client/core/watchQueryOptions.d.ts +++ b/node_modules/apollo-client/core/watchQueryOptions.d.ts @@ -3,30 +3,32 @@ import { FetchResult } from 'apollo-link'; import { DataProxy } from 'apollo-cache'; import { MutationQueryReducersMap } from './types'; import { PureQueryOptions, OperationVariables } from './types'; +import { TypedDocumentNode } from '@graphql-typed-document-node/core'; + export declare type FetchPolicy = 'cache-first' | 'network-only' | 'cache-only' | 'no-cache' | 'standby'; export declare type WatchQueryFetchPolicy = FetchPolicy | 'cache-and-network'; export declare type ErrorPolicy = 'none' | 'ignore' | 'all'; -export interface QueryBaseOptions { - query: DocumentNode; +export interface QueryBaseOptions { + query: DocumentNode | TypedDocumentNode; variables?: TVariables; errorPolicy?: ErrorPolicy; fetchResults?: boolean; metadata?: any; context?: any; } -export interface QueryOptions extends QueryBaseOptions { +export interface QueryOptions extends QueryBaseOptions { fetchPolicy?: FetchPolicy; } -export interface ModifiableWatchQueryOptions extends QueryBaseOptions { +export interface ModifiableWatchQueryOptions extends QueryBaseOptions { pollInterval?: number; notifyOnNetworkStatusChange?: boolean; returnPartialData?: boolean; } -export interface WatchQueryOptions extends QueryBaseOptions, ModifiableWatchQueryOptions { +export interface WatchQueryOptions extends QueryBaseOptions, ModifiableWatchQueryOptions { fetchPolicy?: WatchQueryFetchPolicy; } -export interface FetchMoreQueryOptions { - query?: DocumentNode; +export interface FetchMoreQueryOptions { + query?: DocumentNode | TypedDocumentNode; variables?: Pick; context?: any; } @@ -37,13 +39,13 @@ export declare type UpdateQueryFn TData; export declare type SubscribeToMoreOptions = { - document: DocumentNode; + document: DocumentNode | TypedDocumentNode; variables?: TSubscriptionVariables; updateQuery?: UpdateQueryFn; onError?: (error: Error) => void; }; -export interface SubscriptionOptions { - query: DocumentNode; +export interface SubscriptionOptions { + query: DocumentNode | TypedDocumentNode; variables?: TVariables; fetchPolicy?: FetchPolicy; } @@ -62,7 +64,7 @@ export interface MutationBaseOptions extends MutationBaseOptions { - mutation: DocumentNode; + mutation: DocumentNode | TypedDocumentNode; context?: any; fetchPolicy?: FetchPolicy; }