diff --git a/node_modules/apollo-cache/lib/cache.d.ts b/node_modules/apollo-cache/lib/cache.d.ts index 7d2c3c3..e04213b 100644 --- a/node_modules/apollo-cache/lib/cache.d.ts +++ b/node_modules/apollo-cache/lib/cache.d.ts @@ -2,7 +2,7 @@ import { DocumentNode } from 'graphql'; import { DataProxy, Cache } from './types'; export declare type Transaction = (c: ApolloCache) => void; export declare abstract class ApolloCache implements DataProxy { - abstract read(query: Cache.ReadOptions): T | null; + abstract read(query: Cache.ReadOptions): T | null; abstract write(write: Cache.WriteOptions): void; abstract diff(query: Cache.DiffOptions): Cache.DiffResult; abstract watch(watch: Cache.WatchOptions): () => void; @@ -15,8 +15,8 @@ export declare abstract class ApolloCache implements DataProxy { abstract recordOptimisticTransaction(transaction: Transaction, id: string): void; transformDocument(document: DocumentNode): DocumentNode; transformForLink(document: DocumentNode): DocumentNode; - readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; - readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; + readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; + readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; writeQuery(options: Cache.WriteQueryOptions): void; writeFragment(options: Cache.WriteFragmentOptions): void; writeData({ id, data, }: Cache.WriteDataOptions): void; diff --git a/node_modules/apollo-cache/lib/types/Cache.d.ts b/node_modules/apollo-cache/lib/types/Cache.d.ts index f73aeb1..dfec0ef 100644 --- a/node_modules/apollo-cache/lib/types/Cache.d.ts +++ b/node_modules/apollo-cache/lib/types/Cache.d.ts @@ -4,12 +4,12 @@ export declare namespace Cache { interface EvictionResult { success: Boolean; } - interface ReadOptions extends DataProxy.Query { + interface ReadOptions extends DataProxy.Query { rootId?: string; previousResult?: any; optimistic: boolean; } - interface WriteOptions extends DataProxy.Query { + interface WriteOptions extends DataProxy.Query { dataId: string; result: TResult; } diff --git a/node_modules/apollo-cache/lib/types/DataProxy.d.ts b/node_modules/apollo-cache/lib/types/DataProxy.d.ts index 992df92..d3ff21a 100644 --- a/node_modules/apollo-cache/lib/types/DataProxy.d.ts +++ b/node_modules/apollo-cache/lib/types/DataProxy.d.ts @@ -1,19 +1,21 @@ import { DocumentNode } from 'graphql'; +import { TypedDocumentNode } from '@graphql-typed-document-node/core'; + export declare namespace DataProxy { - interface Query { - query: DocumentNode; + interface Query { + query: DocumentNode | TypedDocumentNode; variables?: TVariables; } - interface Fragment { + interface Fragment { id: string; - fragment: DocumentNode; + fragment: DocumentNode | TypedDocumentNode; fragmentName?: string; variables?: TVariables; } - interface WriteQueryOptions extends Query { + interface WriteQueryOptions extends Query { data: TData; } - interface WriteFragmentOptions extends Fragment { + interface WriteFragmentOptions extends Fragment { data: TData; } interface WriteDataOptions { @@ -26,8 +28,8 @@ export declare namespace DataProxy { }; } export interface DataProxy { - readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; - readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; + readQuery(options: DataProxy.Query, optimistic?: boolean): QueryType | null; + readFragment(options: DataProxy.Fragment, optimistic?: boolean): FragmentType | null; writeQuery(options: DataProxy.WriteQueryOptions): void; writeFragment(options: DataProxy.WriteFragmentOptions): void; writeData(options: DataProxy.WriteDataOptions): void; diff --git a/node_modules/apollo-cache/src/types/DataProxy.ts b/node_modules/apollo-cache/src/types/DataProxy.ts index 8b85709..cc8a1bf 100644 --- a/node_modules/apollo-cache/src/types/DataProxy.ts +++ b/node_modules/apollo-cache/src/types/DataProxy.ts @@ -1,13 +1,14 @@ import { DocumentNode } from 'graphql'; // eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved +import { TypedDocumentNode } from '@graphql-typed-document-node/core'; export namespace DataProxy { - export interface Query { + export interface Query { /** * The GraphQL query shape to be used constructed using the `gql` template * string tag from `graphql-tag`. The query will be used to determine the * shape of the data to be read. */ - query: DocumentNode; + query: DocumentNode | TypedDocumentNode; /** * Any variables that the GraphQL query may depend on. @@ -15,7 +16,7 @@ export namespace DataProxy { variables?: TVariables; } - export interface Fragment { + export interface Fragment { /** * The root id to be used. This id should take the same form as the * value returned by your `dataIdFromObject` function. If a value with your @@ -29,7 +30,7 @@ export namespace DataProxy { * the shape of data to read. If you provide more than one fragment in this * document then you must also specify `fragmentName` to select a single. */ - fragment: DocumentNode; + fragment: DocumentNode | TypedDocumentNode; /** * The name of the fragment in your GraphQL document to be used. If you do @@ -45,7 +46,7 @@ export namespace DataProxy { } export interface WriteQueryOptions - extends Query { + extends Query { /** * The data you will be writing to the store. */ @@ -53,7 +54,7 @@ export namespace DataProxy { } export interface WriteFragmentOptions - extends Fragment { + extends Fragment { /** * The data you will be writing to the store. */ @@ -87,7 +88,7 @@ export interface DataProxy { * Reads a GraphQL query from the root query id. */ readQuery( - options: DataProxy.Query, + options: DataProxy.Query, optimistic?: boolean, ): QueryType | null; @@ -97,7 +98,7 @@ export interface DataProxy { * provided to select the correct fragment. */ readFragment( - options: DataProxy.Fragment, + options: DataProxy.Fragment, optimistic?: boolean, ): FragmentType | null;