getanteon / anteon

Anteon (formerly Ddosify) - Effortless Kubernetes Monitoring and Performance Testing. Available on CLI, Self-Hosted, and Cloud
https://getanteon.com
GNU Affero General Public License v3.0
8.37k stars 379 forks source link

How can the response of GraphQL inner http status codes be examined? #79

Open bigman73 opened 2 years ago

bigman73 commented 2 years ago

GraphQL operations that fail still return a 200 HTTP status code even if the inner resolvers fail How can ddosify be used with GraphQL operations?

I'd like to see ddosify fail when inner GraphQL resolvers fail. Right now there's a success for failed executions since the GraphQL response is 200 on the external response.

kursataktas commented 2 years ago

Hi @bigman73

Currently success/fail logic is simple. If Ddosify receives the response, that is a successful request/response cycle. If somehow a request couldn't send or response couldn't received (like timeout) then it is a failed cycle.

Ddosify provides HTTP response codes to let the developer parse it and create their own assertion logic. Using stdout-json as the output type makes this process simpler.

We'll implement a custom assertion logic, so you can easily create your own success/fail criteria. Like, if the response body containsr/regex/ then mark the request as failed, etc. I think that's what you are looking for. If so, could you please provide your use case with an example? This will make the development more targeted to solve your issue.

bigman73 commented 2 years ago

Hi @kursataktas Thanks for your prompt reply. For GraphQL the HTTP response code won't help because it is 200 even if the inner resolvers return errors.

A custom regular expression seems like a very good solution. It should be easy to create custom 'rules' with regex.