You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,19 @@ This project works in the following way:
22
22
23
23
Most libraries supports `DocumentNode` as the type of the query object, but that's not enough to use this library.
24
24
25
+
Our goal is to get built-in support in major libraries, in order
26
+
25
27
In order to extend the behavior, we are using `patch-package` library internally, to add support for `TypedDocumentNode` and add the support for type inference.
-`apollo-client` (`~2.6.10`, including `apollo-cache`)
@@ -69,7 +78,15 @@ generates:
69
78
70
79
3. Try to run codegen by using: `yarn graphql-codegen`, it should create the `./src/graphql-operations.ts` file for you, with the generated `TypedDocumentNode` objects.
71
80
72
-
4. Configure the patch CLI to run as `postinstall` script:
81
+
If you are using a library that doesn't support `TypedDocumentNode` yet, you can apply a patch, by doing:
2. Configure the patch CLI to run as `postinstall` script:
73
90
74
91
```json
75
92
{
@@ -79,6 +96,8 @@ generates:
79
96
}
80
97
```
81
98
99
+
5. Reinstall dependencies (using npm or yarn) - it will now patch the relevant libraries.
100
+
82
101
Now, after installing your projects' dependencies, it will make sure to patch all relevant packages and make it available for use with `TypedDocumentNode`.
0 commit comments