-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Lenz Weber-Tronic <lorenz.weber-tronic@apollographql.com> Co-authored-by: Ben Newman <ben@apollographql.com>
- Loading branch information
1 parent
ea77bae
commit 79df2c7
Showing
25 changed files
with
3,762 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
'@apollo/client': minor | ||
--- | ||
|
||
Add the ability to specify custom GraphQL document transforms. These transforms are run before reading data from the cache, before local state is resolved, and before the query document is sent through the link chain. | ||
|
||
To register a custom document transform, create a transform using the `DocumentTransform` class and pass it to the `documentTransform` option on `ApolloClient`. | ||
|
||
```ts | ||
import { DocumentTransform } from '@apollo/client'; | ||
|
||
const documentTransform = new DocumentTransform((document) => { | ||
// do something with `document` | ||
return transformedDocument; | ||
}); | ||
|
||
const client = new ApolloClient({ documentTransform: documentTransform }); | ||
``` | ||
|
||
For additional documentation on the behavior and API of `DocumentTransform`, see the [pull request](https://github.com/apollographql/apollo-client/pull/10509). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
# format "ObservableQuery" test (in #10597) | ||
104bf11765b1db50292f9656aa8fe48e2d749a83 | ||
|
||
# format changes from ee0b4ae | ||
f7890ae96a3ba900d3de9bf8b23254bcfba18a25 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.