Graphql query error handling issue for HTTP status code of 200

Hi,

It seems to be common practice that a Graphql endpoint should return an HTTP status 200 on errors occuring at the GraphQL layer and publish an errors Array containing the error related information. It does not seem like this is correctly handled by Retool GraphQL query since the failure event handler is never triggered even though the errors array contains entries.

Maybe I have missed something ?

Kind Thanks,
Serge

Found this in the state inspector for the GraphQL query but have not found where to enable it.... referring to the "enableErrorTransformer" ...

This just seems so basic ?

Screenshot 2024-11-30 at 13.08.40

Hi @ssozonoff,

Thanks for reaching out! Since the status code is a 200, the failure event won't trigger. You could use a success event instead that triggers conditionally if there is an error (i.e. set the Only run when setting to check for errors)

Thanks I am sure there is some manual work arounds but the point is that for Graphql queries the norm is to return a 200 OK on errors and populate the errors property. Just not sure what Retool's reasoning around this one.

Thanks for your reply,
Serge

Hi @ssozonoff Fair enough, it's a bit hacky. I think it's more for consistency with other integrations :thinking: