enisdenjo / graphql-sse

Zero-dependency, HTTP/1 safe, simple, GraphQL over Server-Sent Events Protocol server and client.
https://the-guild.dev/graphql/sse
MIT License
390 stars 20 forks source link

Example issues #39

Closed elritz closed 1 year ago

elritz commented 1 year ago

Screenshot Visualising is always helpful. Screenshot 2022-12-07 at 2 33 58 PM [Codegen image] This is a codegen file which is connecting to the endpoint where the server with the sse handler is at on endpoint /graphql/stream.

Here is the server running, it is connecting to "/" where i just test to see the h2 in my Network inspector. According to the documentation. Screenshot 2022-12-07 at 2 40 40 PM

Im also unsure about the situation on the client side. I've copied the code exactly and removed the headers part for my own purposes!
Screenshot 2022-12-07 at 2 44 08 PM [Client Side SSELink]

Screenshot 2022-12-07 at 2 44 49 PM [Final Combination for Apollo provider]

https://www.apollographql.com/docs/react/api/link/introduction/#directional-composition [Link to Apollo Documentation on linking]

From reading the Apollo link documentation, A directional integration is appropriate, Screenshot 2022-12-07 at 3 06 47 PM [SSE integration using a Direction Link] (concept not working)

Expected Behaviour I expected it to do this -

Actual Behaviour Im unsure what the server is suppose to return from the handler, but what i expect is probably a schema but currently just unable to connect from the client

Debug Information Help us debug the bug?

Further Information This is a React Native project, i know mobile accepts the h2 unsure if its relevant to the sse package! In the example with the Apollo Client I think it maybe incorrect for h2 because the link isnt using http2! I understand im not asking a specific question but my real issue it i can't seem to make it work for me! If we can make it work i would be happy to provide that update.