Protocol Ecto.Queryable not implemented for Item of type Atom

Working my way through the Phoenix in Action book at chapter 7.5.3, and I’m getting the following error:

iex(1)> Auction.list_items()
** (Protocol.UndefinedError) protocol Ecto.Queryable not implemented for Item of type Atom, the given module does not exist. This protocol is implemented for the following type(s): Atom, BitString, Ecto.Query, Ecto.SubQuery, Tuple
(ecto) lib/ecto/queryable.ex:40: Ecto.Queryable.Atom.to_query/1
(ecto) lib/ecto/repo/queryable.ex:14: Ecto.Repo.Queryable.all/3

I’m sort of stuck as I had this working yesterday. Help Please. This is my repo mpchean/auction_umbrella

(emphasis mine)

You likely have code like Repo.all(Item) so either use MyApp.Item or use an alias.

Thank you I think i see my issue based on your solution

1 Like