Skip to main content

200 status code for Error Api response

  • November 17, 2021
  • 1 reply
  • 173 views

anilkumblel001

Team,

When I execute a graphql api for few case the api is success and it returns the data.
But if we make any mistakes in constructing the query or some other error then that time in the response it has errors but it gives us 200 as API Status code. How can we distinguish success and failure APIs. 

Can‘t we find this from the API status code ?

1 reply

genietim
Forum|alt.badge.img+12
  • Pipefy Legend
  • 412 replies
  • November 18, 2021

I agree, a status 200 for an erronous query is not very helpful. I do the checks by looking whether the response JSON has the property “errors”.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings