bug: GraphiQL intermittently fails to work with the <DGS_GRAPHQL_PATH> failing to be replaced
Expected behavior
When I use the GraphiQL it should work
Actual behavior
A picture is worth a thousand words:
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.
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 I added more precisions to the original message. Let me know if that's sufficient.
HI. Still getting this error using latest 8.2.2. Any updates on the matter ? Thanks
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.
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 I was able to reproduce this...
Steps to reproduce:
- Start the server
- Navigate to
http://localhost:8080/graphiql/index.html?query=foo - Error shows up in response pane:
message": "Window.fetch: http://localhost:8080<DGS_GRAPHQL_PATH> is not a valid URL.", - No queries will work now.
Workaround:
- Start the server
- Navigate to
http://localhost:8080/graphiql/index.html(must end with/index.html) - 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 ofuri, or something without the query params.
Hope this helps. This was a tricky one.