warrenday / graphql-network-inspector

A better network inspector for viewing and debugging GraphQL requests.
MIT License
484 stars 47 forks source link

Support using proxy/ngrok #121

Closed simplenotezy closed 4 months ago

simplenotezy commented 7 months ago

Is your feature request related to a problem? Please describe. This is a pretty sweet UI and would love to be able to use this similar to how ngrok works (which we currently use for mobile development).

Describe the solution you'd like You run a command, e.g. gqlinspect http <some-port> - it creates a service on your localhost that proxies some-port and publishes this to a new port (e.g. 3001). Then you can setup your graphql client to communicate on port 3001 while being able to use graphql-network-inspect to inspect the contents easily! 🎉

-endpoint: "http://localhost:3000/graphql",
+endpoint: "http://localhost:3001/graphql", // proxies to port 3000 but with sweet graphql-network-inspector UI

Describe alternatives you've considered Modifying the ngrok page (http://127.0.0.1:4040/inspect/http) with a chrome extension to replace POST /graphql with Query Profile(id: 123)

Additional context We spend tremendeous amount of aggregated time in finding a specific request in the haystack of requests while developing/debugging. Having a cleaner and more graphql oriented solution would help save a lot of time.

warrenday commented 7 months ago

Hey @simplenotezy

What does your current debugging process look like, are you pulling up chrome devtools using remote debugging? I'm just thinking would it be possible to enable extensions on devtools this way, if so you'd be able to access the UI.

simplenotezy commented 7 months ago

hey @warrenday - no I don't use chrome. I just boot up our backend server and run ngrok http 3000

warrenday commented 7 months ago

We did actually explore a desktop version of the app at one point, it creates a local proxy server, and intercept all requests. However proved unpopular so I stopped development.

Could be worth a go for your use case.

https://github.com/warrenday/graphql-network-inspector-desktop/releases

Screenshot 2024-02-15 at 15 58 30
simplenotezy commented 7 months ago

Interesting @warrenday - how does it work? Does it proxy?

warrenday commented 4 months ago

Closing as no plan to integrate with a proxy service. We only read from the browser HAR logs.