Skip to content

Conversation

szymonkozak
Copy link

In some cases, when we have an Ecto payload, primary key can be set to nil. This can lead to situation where dataloader is associating the incorrect child object to a parent object. (See the issue here: #172).

This helps to avoid overlooking such situations by raising when nil was found in primary keys.

In some cases, when we have an Ecto payload, primary key can be set to nil. This can lead to situation where dataloader is associating the incorrect child object to a parent object. (See the issue here: absinthe-graphql#172).

This helps to avoid overlooking such situations by raising when nil was found in primary keys.
@szymonkozak
Copy link
Author

Alternative solution would be to use

 record
    |> :erlang.term_to_iovec()
    |> :erlang.md5()

when we find nils in primary keys (so the same situation like without primary key at all). Then it should work even without primary keys loaded. But I didn't test it and I don't know if it's better. @benwilson512 wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant