Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] How to use jsondiffpatch with apollo-client? #949

Closed
tetchel opened this issue Jul 29, 2022 · 1 comment
Closed

[Question] How to use jsondiffpatch with apollo-client? #949

tetchel opened this issue Jul 29, 2022 · 1 comment

Comments

@tetchel
Copy link

tetchel commented Jul 29, 2022

I don't understand how the example in the readme is meant to be applied to a project which uses apollo-client.

What is networkLayer ? It seems like I should be adding a link which runs after the websocket transport link.

@n1ru4l
Copy link
Owner

n1ru4l commented Jul 29, 2022

Hey @tetchel, pardon the bad documentation. 😭

I quickly created a PR for showcasing usage with patches using apollo-client: #950

The patch middlewares are built around AsyncIterables, thus you first need to convert the EventSource into an AsyncIterable, then apply the patch transforms and last apply the async iterable to the Observable sink.

Of course, this process would be more straightforward if all the GraphQL clients did not decide to use their own "stream"-like structure and instead use JavaScript native structures (AsyncIterable). Anyways that is just me ranting a bit. 😁

Repository owner locked and limited conversation to collaborators Jul 29, 2022
@n1ru4l n1ru4l converted this issue into discussion #951 Jul 29, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants