by rozenmd · 4y ago · 0 comments
I ended up writing my own service[0] to detect problems with graphql responses, before expanding it to cover websites and web apps too.
-[0]: https://onlineornot.com
I sort of almost made myself feel a bit better about it by thinking 'no, it's not REST, we have reached the graphql server successfully and got a .. "successful" response from it, it's sort of a "Layer 8" on top of HTTP'. The problem is that none of the bloody tooling is 'Layer 8', so you end up in browser dev tools with all these 200 responses and no idea which ones are errorful. If any.
That doesn’t mean it’s not bloody annoying.
Especially because error responses from your web server layer are usually really different than errors from your backends.
The standard 503 and 404 codes?
I assume the rational is to not leak information about what's private. But still, it's weird.
I think either approach is valid as long as you're consistent. You can make a case for either 404 or 403 when you don't have enough permissions. In GitHub's case you can argue that it's a 404 because the resource does indeed not exist through your auth context. In AWS' case you can argue that a 403 makes sense because you don't have permission to know the answer to your query.