warrenday / graphql-network-inspector

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

Block request by Operation Name (query name) #63

Closed ultrox closed 6 months ago

ultrox commented 2 years ago

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

warrenday commented 2 years ago

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?

ultrox commented 2 years ago

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.

warrenday commented 2 years ago

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.

ultrox commented 2 years ago

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

warrenday commented 2 years ago

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 commented 6 months ago

Closing as we cannot block requests with the chrome api.