Skip to content

Glossary: GraphQL APIs

Error codes

Also written: UNAUTHENTICATED, FORBIDDEN, NOT_FOUND, BAD_USER_INPUT, OUT_OF_STOCK, BAD_STATUS_CHANGE

Short names in a GraphQLError's `extensions.code` that clients check instead of the message. kc-graph uses NOT_FOUND (no such item), BAD_USER_INPUT (client sent something wrong), UNAUTHENTICATED (nobody logged in, like HTTP 401), FORBIDDEN (wrong role, like HTTP 403), OUT_OF_STOCK (not enough stock) and BAD_STATUS_CHANGE (order can't move to that status).

Where the book teaches it

Related terms

GraphQLErrorextensionsrequireUser / requireStaff