graphql-kit / graphql-voyager

🛰️ Represent any GraphQL API as an interactive graph
https://graphql-kit.com/graphql-voyager/
MIT License
7.69k stars 504 forks source link

NPM 2.0.0 version has major code problems #375

Open IvanSereginGitHub opened 8 months ago

IvanSereginGitHub commented 8 months ago

render-voyager-page.js has window.addEventListener('load') with SYNC function trying to call ASYNC method (await response.json()). Not only that but await response.json() CANNOT be called like that since response is still a PROMISE, not a result object, therefore it should be either (await response).json() or it should be done SYNCHRONOUSLY. And even after all that fixed manually, I still couldn't get past the "Loading..." because of "GraphQLVoyager.init is not a function".

Didn't test previous versions, so can't say anything about them. Please fix NPM 2.0.0 version, considering those problems - I doubt that it was tested at all...

mnlbox commented 8 months ago

Related: https://github.com/graphql-kit/graphql-voyager/issues/372