In our MySQL table the enum field is nullable by default. When the nil is received from a query, it is passed into the load/1 function, which is only expecting the values of the enum, and does not handle a nil value.
Request: POST /graphql
** (exit) an exception was raised:
** (FunctionClauseError) no function clause matching in BusinessType.load/1
(emporos) lib/emporos/models/stripe/business_type.ex:3: BusinessType.load(nil)
I would expect that the nil should just get passed through to nil from the load/1 function.
In our MySQL table the enum field is nullable by default. When the
nil
is received from a query, it is passed into theload/1
function, which is only expecting the values of the enum, and does not handle anil
value.I would expect that the
nil
should just get passed through tonil
from theload/1
function.