graphql-network-inspector icon indicating copy to clipboard operation
graphql-network-inspector copied to clipboard

Block request by Operation Name (query name)

Open ultrox opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. I'm very frustrated by the fact when I'm testing and want to cover error cases can't block specific queries/mutations. Blocking API endpoint would not work here as everything will be blocked

Describe the solution you'd like A clear and concise description of what you want to happen. I would like to be able to click on any operation name from the list and just block it for or block it for x amount of time.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. n/a

Additional context Add any other context or screenshots about the feature request here. n/a

ultrox avatar Apr 05 '22 20:04 ultrox

Hey thanks for raising this.

When you say block do you mean hold the request and leave it hanging for a time period or forever, or do you mean force the request to return an error of your choosing?

warrenday avatar Apr 05 '22 22:04 warrenday

Depending on project goals I guess. I see it go in two directions.

First, simpler just features in pair with what dev tools already have. Simple block by operation name.

Second, more complex let's say something along the lines of cypress.intercept.

ultrox avatar Apr 07 '22 20:04 ultrox

Currently, you can intercept requests with the desktop app (beta). If you're interested in the product I can add request blocking as well. https://www.graphproxy.com/

For more details on mocking/intercepting requests check out the docs page "mocking" section. https://graphproxy.com/docs

Hopefully this can solve your problem.

warrenday avatar Apr 09 '22 18:04 warrenday

I know about that, but I'm using Linux.

ultrox avatar Apr 09 '22 19:04 ultrox

The main focus is on desktop right now. But i'll check the chrome api to see if blocking is possible. However for the case of returning different data/errors would only be possible with a desktop app.

warrenday avatar Apr 14 '22 07:04 warrenday

Closing as we cannot block requests with the chrome api.

warrenday avatar Mar 18 '24 10:03 warrenday