dgs-framework icon indicating copy to clipboard operation
dgs-framework copied to clipboard

bug: GraphiQL intermittently fails to work with the <DGS_GRAPHQL_PATH> failing to be replaced

Open lthoulon-locala opened this issue 2 years ago • 4 comments

Expected behavior

When I use the GraphiQL it should work

Actual behavior

A picture is worth a thousand words:

Capture d’écran 2023-10-10 à 11 20 44

This happens when I load /graphiql. The page shows up fine but it triggers the introspection query that returns this error. Once the error is there it never goes away unless I restart the server and I get lucky. We've tried increasing the machine's resources and it seems to solve the issue confirming IMO the race condition theory.

Steps to reproduce

Not sure how to reproduce as it's not always the case. Seems like some race condition as described in #1135 It almost never happens locally on my Mac M1 and almost always happen on our dev developpement server that has much less resources (CPU, ram, ...) I'm using version 7.5.3 of the dgs-bom.

lthoulon-locala avatar Oct 10 '23 09:10 lthoulon-locala

Hello @lthoulon-locala. Can you explain more about what steps you are taking to use GraphiQL and where in that process you are getting the error?

kailyak avatar Oct 11 '23 21:10 kailyak

@kailyak I added more precisions to the original message. Let me know if that's sufficient.

lthoulon-locala avatar Oct 16 '23 08:10 lthoulon-locala

HI. Still getting this error using latest 8.2.2. Any updates on the matter ? Thanks

lthoulon-locala avatar Jan 22 '24 14:01 lthoulon-locala

Hi @lthoulon-locala - unfortunately we are not able to reproduce this issue either. If you have a branch or a test case that can reproduce this, we can dig into this further.

srinivasankavitha avatar Jan 22 '24 18:01 srinivasankavitha

Graphiql is now handled by the DGS / Spring-GraphQL integration, so even if we would be able to reproduce the fix won't be in DGS itself. Closing as it is no longer actionable.

paulbakker avatar Aug 16 '24 22:08 paulbakker

@paulbakker I was able to reproduce this...

Steps to reproduce:

  1. Start the server
  2. Navigate to http://localhost:8080/graphiql/index.html?query=foo
  3. Error shows up in response pane: message": "Window.fetch: http://localhost:8080<DGS_GRAPHQL_PATH> is not a valid URL.",
  4. No queries will work now.

Workaround:

  1. Start the server
  2. Navigate to http://localhost:8080/graphiql/index.html (must end with /index.html)
  3. Works now

Issue:

  • The transformer in the configurer only runs once, the first time the index.html page is loaded.
  • Since it's looking for endsWith, if there's any query params on the uri, it won't substitute the values.
  • recommend checking the exchange.request.path.value() instead of uri, or something without the query params.

Hope this helps. This was a tricky one.

neiltolson avatar Sep 04 '24 17:09 neiltolson