Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bigman73 opened this issue Aug 26, 2022 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@bigman73
Copy link

bigman73 commented Aug 26, 2022

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.

@bigman73 bigman73 changed the title How can the response of GraphQL inner http status codes can be examined? How can the response of GraphQL inner http status codes be examined? Aug 26, 2022
@kursataktas
Copy link
Member

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
Copy link
Author

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.

@kursataktas kursataktas added the enhancement New feature or request label Aug 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants