Skip to content

Commit cbc03cf

Browse files
committed
updated apollo-cache typings
1 parent 1e561de commit cbc03cf

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

packages/patch-cli/src/patches/apollo-cache+~1.3.0.patch

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,60 @@ index 992df92..43979af 100644
3232
writeQuery<TData = any, TVariables = any>(options: DataProxy.WriteQueryOptions<TData, TVariables>): void;
3333
writeFragment<TData = any, TVariables = any>(options: DataProxy.WriteFragmentOptions<TData, TVariables>): void;
3434
writeData<TData = any>(options: DataProxy.WriteDataOptions<TData>): void;
35+
diff --git a/node_modules/apollo-cache/src/types/DataProxy.ts b/node_modules/apollo-cache/src/types/DataProxy.ts
36+
index 8b85709..4f2a2f3 100644
37+
--- a/node_modules/apollo-cache/src/types/DataProxy.ts
38+
+++ b/node_modules/apollo-cache/src/types/DataProxy.ts
39+
@@ -1,13 +1,14 @@
40+
import { DocumentNode } from 'graphql'; // eslint-disable-line import/no-extraneous-dependencies, import/no-unresolved
41+
+import { TypedDocumentNode } from '@graphql-typed-document-node/core';
42+
43+
export namespace DataProxy {
44+
- export interface Query<TVariables> {
45+
+ export interface Query<TVariables, TData = any> {
46+
/**
47+
* The GraphQL query shape to be used constructed using the `gql` template
48+
* string tag from `graphql-tag`. The query will be used to determine the
49+
* shape of the data to be read.
50+
*/
51+
- query: DocumentNode;
52+
+ query: DocumentNode | TypedDocumentNode<TData, TVariables>;
53+
54+
/**
55+
* Any variables that the GraphQL query may depend on.
56+
@@ -15,7 +16,7 @@ export namespace DataProxy {
57+
variables?: TVariables;
58+
}
59+
60+
- export interface Fragment<TVariables> {
61+
+ export interface Fragment<TVariables, TData = any> {
62+
/**
63+
* The root id to be used. This id should take the same form as the
64+
* value returned by your `dataIdFromObject` function. If a value with your
65+
@@ -29,7 +30,7 @@ export namespace DataProxy {
66+
* the shape of data to read. If you provide more than one fragment in this
67+
* document then you must also specify `fragmentName` to select a single.
68+
*/
69+
- fragment: DocumentNode;
70+
+ fragment: DocumentNode | TypedDocumentNode<TData, TVariables>;
71+
72+
/**
73+
* The name of the fragment in your GraphQL document to be used. If you do
74+
@@ -87,7 +88,7 @@ export interface DataProxy {
75+
* Reads a GraphQL query from the root query id.
76+
*/
77+
readQuery<QueryType, TVariables = any>(
78+
- options: DataProxy.Query<TVariables>,
79+
+ options: DataProxy.Query<TVariables, QueryType>,
80+
optimistic?: boolean,
81+
): QueryType | null;
82+
83+
@@ -97,7 +98,7 @@ export interface DataProxy {
84+
* provided to select the correct fragment.
85+
*/
86+
readFragment<FragmentType, TVariables = any>(
87+
- options: DataProxy.Fragment<TVariables>,
88+
+ options: DataProxy.Fragment<TVariables, FragmentType>,
89+
optimistic?: boolean,
90+
): FragmentType | null;
91+

0 commit comments

Comments
 (0)