Craft GraphQL APIs in Elixir with Absinthe Part Five

I am now onto the mutations chapter.

It seems that Decimal has changed it’s parse return. It used to be {:ok, decimal} but is now {decimal, remainder} which means that you will need the following to get Chapter 5 to build:

  scalar :decimal do
    parse fn
      %{value: value}, _ ->
        {d,_} = Decimal.parse(value)
        {:ok, d}
      _, _ ->
    serialize &to_string/1

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s