Skip to content
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

[BUG] Regressions with "graphql-sse" subscription handling with altair-static. #2737

Open
1 task done
MurrayFurtado opened this issue Dec 10, 2024 · 6 comments
Open
1 task done

Comments

@MurrayFurtado
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have migrated from v7.0.1 to v8.0.5 and observe the following problems:

I configure initialSubscriptionRequestHandlerId: "graphql-sse" in my RenderOptions object and pass this to the renderAltair() method, along with a query and a subscription endpoint. When I click on run subscription I notice that once the subscription returns, it continually re-executes the query until I press cancel and it appends the duplicate results in the results window.

Secondly when I open the Request Handlers dialog I expect my Subscription Handler value to be set to Graphql Over SSE but it's still set on "websocket".

All this functionality used to work in v7.0.1 (except I had to specify initialSubscriptionsProvider: "graphql-sse" instead of initialSubscriptionRequestHandlerId)

Expected Behavior

When I click on run subscription it should just run my subscription query once.
When I open up the Request Handlers dialog I should see my Subscription Handler set to Graphql Over SSE

Steps To Reproduce

Problem manifests when initialSubscriptionRequestHandlerId: "graqhql-sse" with a given query.

Environment

- OS:  Windows
- Browser:   Chrome
- Platform:  ?
- Version: v8.0.5 of altair-static

Additional context

No response

@imolorhe
Copy link
Collaborator

imolorhe commented Dec 15, 2024

Thanks for reporting. I can confirm the issue. Will be fixed in the next release in #2741

@MurrayFurtado
Copy link
Author

MurrayFurtado commented Dec 30, 2024

Hi there @imolorhe. So I upgraded to v8.1.1 and I see that the 2nd issue is fixed - ie it's showing the correct Subscription Handler in the Request Handlers dialog now. But the first and more problematic issue is still present - ie it's making repeated calls to the endpoint to get the same results. Any ideas?

@imolorhe
Copy link
Collaborator

@MurrayFurtado What version of graphql-sse do you use? Also are you using the single or distinct connection mode?

@imolorhe
Copy link
Collaborator

imolorhe commented Dec 30, 2024

The graphql-sse client logic used in Altair is relatively simple too as the graphql-sse library is doing the heavylifting

this.cleanup = this.client.subscribe(
{
query: request.query,
variables: request.variables,
operationName: request.selectedOperation ?? undefined,
extensions: request.extensions,
},

@MurrayFurtado
Copy link
Author

@imolorhe I use whatever version of graphql-sse is specified by altair client. The server side being called is a java spring boot service which implements a custom SSE solution for returning data.

@imolorhe
Copy link
Collaborator

imolorhe commented Jan 6, 2025

@MurrayFurtado I'm still not able to reproduce the issue. I have a test server in the repo that also uses graphql-sse and it works fine when I test it. It's possible there's some specific usage pattern or configuration that is different but I can't tell what it is since I can't reproduce it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants