mchean
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
Marked As Solved
wojtekmach
(emphasis mine)
You likely have code like Repo.all(Item) so either use MyApp.Item or use an alias.
Also Liked
al2o3cr
The code you’ve shown correctly aliases Product, but that’s not what the error message is about!
My guess is that there’s a has_many :categories, Category in product.ex but no alias Hello.Catalog.Category.
mchean
Thank you I think i see my issue based on your solution
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









