Essentially you had an error in your schema:
web/schema.ex
query do
@desc "Get all blog posts"
field :posts, list_of(:post) do # This needs list_of()
resolve &Blog.PostResolver.all/2 # because this will return 0-to-many results
end
@desc "Get a user of the blog"
field :user, type: :user do # This doesn't need list_of()
arg :id, non_null(:id)
resolve &Blog.PostResolver.find/2 # because this will return 0-or-1 results
end
end
The missing list_of resulted in the default_resolve being presented with data that it shouldn’t have to handle.
This demonstrates that one should not immediately assume that the fault lies where it manifests itself - the problem is often further up stream.


















