3 ms·
Yes that would be 404. Similar to how there's no difference between "there's no /pets/" or "there is no /pet/15", they are both 404 for /pets/15 400 is also a
by remram 4y ago
Yes that would be 404.
Similar to how there's no difference between "there's no /pets/" or "there is no /pet/15", they are both 404 for /pets/15
400 is also a good code for "your query doesn't make sense". Anything but 200 really.
- AdieuToLogic 4y agoWhile using HTTP status codes could work for GraphQL payloads which have only one operation in them, this approach would not work for those which have multiple[0]. 0 - http://spec.graphql.org/October2021/#sec-Executing-Requests http://spec.graphql.org/October2021/#sec-Executing-Requests
- remram 4y ago207 has been used for that for decades. GraphQL looks like it's been implemented by someone who thought 200 and 404 were the only possible codes.
- AdieuToLogic 4y ago> 207 has been used for that for decades. That's a WebDAV status code. > GraphQL looks like it's been implemented by someone who thought 200 and 404 were the only possible codes. Maybe. Or maybe they decided that a 2xx status would be interpreted as "success" by a non-trivial set of libraries and/or systems. Either way, take it up with the standards committee :-).