[erlang-questions] [ANN] GraphQL Erlang 0.8.0

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Wed May 24 16:57:04 CEST 2017


On Wed, May 24, 2017 at 4:31 PM Son Tran-Nguyen <son@REDACTED> wrote:

>
> If any, please consider letting the develop to choose whether they want to
> convert the binary to atom. If the library switch itself to using atoms,
> then the developer cannot really do anything about it.
>
>
If we make the switch, I'm pretty sure the developers won't be given a
choice. The complexity of managing this will essentially mean every module
in the system needs lots of small fixups. The cost/benefit analysis doesn't
pan out.

The impedance mismatch is when you have a field as an atom, 'created' for
instance. But your object stores it as <<"created">> in a map or proplist.
In this case, the code would change from

execute(_, Obj, Field, _) -> {ok, maps:get(Field, Obj, null)}

to

execute(_, Obj, Field, _) -> {ok, maps:get(atom_to_binary(Field, utf8),
Obj, null)}

which I don't think is a problem in the long run. It would help if the data
is a #record{} type on the other hand.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170524/2931ec1e/attachment.htm>


More information about the erlang-questions mailing list