Open chadfurman opened 7 years ago
Specifically:
-- check phone number format
if phone_number !~ '^\+[0-9]{8,20}$' then
RAISE EXCEPTION 'Your phone number must start with a +, contain only numbers, and be at least 8 digits long.'
USING ERRCODE = '12345';
return null;
end if;
yields
{
"data": {
"authenticate": null
},
"errors": [
{
"message": "Your phone number must start with a +, contain only numbers, and be at least 8 digits long.",
"locations": [
{
"line": 9,
"column": 3
}
],
"path": [
"authenticate"
]
}
]
}
as well as the extendedErrors feature: https://github.com/postgraphql/postgraphql/pull/513
This is a good reference point: https://github.com/postgraphql/postgraphql/issues/485#issuecomment-330160947