-
I don't understand how the example in the readme is meant to be applied to a project which uses What is |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
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. 😁 |
Beta Was this translation helpful? Give feedback.
-
I see your example uses SSE, how could I turn a websocket (or |
Beta Was this translation helpful? Give feedback.
-
Additionally, on the server side, is this correct? edit: I think the problem is on the client side, it looks like some of the socket events are not reaching the jsondiffpatch sink. this is with my own attempt at a websocket + repeater implementation but obviously it's missing some key piece. import { InMemoryLiveQueryStore } from '@n1ru4l/in-memory-live-query-store'
import { applyLiveQueryJSONDiffPatchGenerator } from '@n1ru4l/graphql-live-query-patch-jsondiffpatch'
const liveQueryStore = new InMemoryLiveQueryStore()
const executeQuery = liveQueryStore.makeExecute(execute)
useServer(
{
schema,
execute: (args: ExecutionArgs) =>
applyLiveQueryJSONDiffPatchGenerator(executeQuery(args)),
onSubscribe: async (options, msg) => {
// ... etc
|
Beta Was this translation helpful? Give feedback.
-
I see this error in the console: while the error thrown is the standard one from trying to invoke |
Beta Was this translation helpful? Give feedback.
-
Please use https://github.com/n1ru4l/graphql-live-query/tree/main/packages/todo-example as a reference on how to properly configure graphql-live-query with your choice of server, client, and transport. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I've got it working using your example! May I ask, what this comment about the apollo-client version is regarding? |
Beta Was this translation helpful? Give feedback.
Please use https://github.com/n1ru4l/graphql-live-query/tree/main/packages/todo-example as a reference on how to properly configure graphql-live-query with your choice of server, client, and transport.