-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: example of using apollo with patch (#950)
* feat: example of using apollo with patch * feat: use jsondiffpatch everywhere
- Loading branch information
Showing
35 changed files
with
443 additions
and
115 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,5 @@ | ||
--- | ||
"@n1ru4l/graphql-live-query-patch": patch | ||
--- | ||
|
||
Ensure the `data` property reference changes for each published value in order to please GraphQL clients that rely on immutability. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
15 changes: 15 additions & 0 deletions
15
packages/todo-example/client-apollo/src/apollo-link/shared.ts
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,15 @@ | ||
import { applyLiveQueryJSONDiffPatch } from "@n1ru4l/graphql-live-query-patch-jsondiffpatch"; | ||
import { | ||
applyAsyncIterableIteratorToSink, | ||
Sink, | ||
} from "@n1ru4l/push-pull-async-iterable-iterator"; | ||
|
||
export function applySourceToSink( | ||
source: AsyncIterableIterator<any>, | ||
sink: Sink<any> | ||
): () => void { | ||
return applyAsyncIterableIteratorToSink( | ||
applyLiveQueryJSONDiffPatch(source), | ||
sink | ||
); | ||
} |
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
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,15 @@ | ||
import { applyLiveQueryJSONDiffPatch } from "@n1ru4l/graphql-live-query-patch-jsondiffpatch"; | ||
import { | ||
applyAsyncIterableIteratorToSink, | ||
Sink, | ||
} from "@n1ru4l/push-pull-async-iterable-iterator"; | ||
|
||
export function applySourceToSink( | ||
source: AsyncIterableIterator<any>, | ||
sink: Sink<any, any> | ||
): () => void { | ||
return applyAsyncIterableIteratorToSink( | ||
applyLiveQueryJSONDiffPatch(source), | ||
sink | ||
); | ||
} |
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
15 changes: 15 additions & 0 deletions
15
packages/todo-example/client-urql/src/urql-client/shared.ts
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,15 @@ | ||
import { applyLiveQueryJSONDiffPatch } from "@n1ru4l/graphql-live-query-patch-jsondiffpatch"; | ||
import { | ||
applyAsyncIterableIteratorToSink, | ||
Sink, | ||
} from "@n1ru4l/push-pull-async-iterable-iterator"; | ||
|
||
export function applySourceToSink( | ||
source: AsyncIterableIterator<any>, | ||
sink: Sink<any> | ||
): () => void { | ||
return applyAsyncIterableIteratorToSink( | ||
applyLiveQueryJSONDiffPatch(source), | ||
sink | ||
); | ||
} |
Oops, something went wrong.