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

Ruru headers are not passed along with requests to /graphql/stream #1913

Closed
flyte opened this issue Jan 17, 2024 · 4 comments
Closed

Ruru headers are not passed along with requests to /graphql/stream #1913

flyte opened this issue Jan 17, 2024 · 4 comments
Labels

Comments

@flyte
Copy link

flyte commented Jan 17, 2024

Summary

Now that #1828 is fixed, the next request that Ruru does is to the /graphql/stream endpoint. However, it also doesn't send the headers along with the request, so it receives a 403 from our backend and causes Ruru to crash to a white screen with the following in the console:

GET http://localhost:4180/graphql/stream 403 (Forbidden)
graphiql:24 Ruru: Failed to connect to event stream Event {isTrusted: true, type: 'error', target: EventSource, currentTarget: EventSource, eventPhase: 2, …}
n @ graphiql:24
error (async)
(anonymous) @ graphiql:24
il @ graphiql:24
xu @ graphiql:24
uu @ graphiql:24
zi @ graphiql:24
(anonymous) @ graphiql:24
Eu @ graphiql:24
ou @ graphiql:24
E @ graphiql:24
L @ graphiql:24
graphiql:24 Error: Lifecycle management error for EventSource
    at graphiql:24:1692214
    at il (graphiql:24:700503)
    at xu (graphiql:24:720625)
    at uu (graphiql:24:712926)
    at zi (graphiql:24:653915)
    at graphiql:24:719427
    at Eu (graphiql:24:719432)
    at ou (graphiql:24:711929)
    at E (graphiql:24:745027)
    at MessagePort.L (graphiql:24:745559)
ps @ graphiql:24
n.callback @ graphiql:24
Bo @ graphiql:24
wl @ graphiql:24
Al @ graphiql:24
bl @ graphiql:24
(anonymous) @ graphiql:24
Eu @ graphiql:24
uu @ graphiql:24
zi @ graphiql:24
(anonymous) @ graphiql:24
Eu @ graphiql:24
ou @ graphiql:24
E @ graphiql:24
L @ graphiql:24
graphiql:24 Uncaught Error: Lifecycle management error for EventSource
    at graphiql:24:1692214
    at il (graphiql:24:700503)
    at xu (graphiql:24:720625)
    at uu (graphiql:24:712926)
    at zi (graphiql:24:653915)
    at graphiql:24:719427
    at Eu (graphiql:24:719432)
    at ou (graphiql:24:711929)
    at E (graphiql:24:745027)
    at MessagePort.L (graphiql:24:745559)
(anonymous) @ graphiql:24
il @ graphiql:24
xu @ graphiql:24
uu @ graphiql:24
zi @ graphiql:24
(anonymous) @ graphiql:24
Eu @ graphiql:24
ou @ graphiql:24
E @ graphiql:24
L @ graphiql:24

Steps to reproduce

  1. Enter custom headers in the 'Headers' section.
  2. Make sure that "Save headers" is ticked.
  3. Refresh the Ruru page
  4. Check the Network tab, where you can confirm that the POST to /graphql for the introspection query does include the custom headers, but the GET to /graphql/stream does not.

Expected results

Headers should be send along with the GET to /graphql/stream.

Actual results

They are not.

Additional context

Ruru version 2.0.0-beta.10

Possible Solution

Attach the custom headers to the HTTP call.

@flyte flyte added the 🐛 bug label Jan 17, 2024
@benjie
Copy link
Member

benjie commented Jan 17, 2024

I'm unconvinced that the /graphql/stream endpoint should receive headers of any kind, it's identical for all users and does not contain sensitive information.

@flyte
Copy link
Author

flyte commented Jan 17, 2024 via email

@benjie
Copy link
Member

benjie commented Jan 17, 2024

It is only used in watch mode and its purpose is to indicate that the schema has changed and should be re-introspected.

@flyte
Copy link
Author

flyte commented Jan 18, 2024

Thanks for the quick clarification @benjie - looks like we're up and running again!

@flyte flyte closed this as completed Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants