timpritlove

timpritlove

Ash Framework: P1.0 Chapter 9: „Following a New Artist“: ash.extend runs into an error

Chapter 9, section “Following a New Artist” is first instructing to add a new domain function follow_artist to Tunez.Music. But this function demands a create: action on Tunez.Music.ArtistFollower that does not yet exist.

Adding such a function is then suggested in the next paragraph but as it is not properly marked to be actually added (there is no blue bar referencing the file in which the change should occur) this can be understood as a sidenote which will be fixed later as the text says that function is not in the form “we want”. So most readers will just take notice and proceed.

However, the book then tells the reader to first “enable GraphQL support for the ArtistFollower resource by calling “mix ash.extend Tunez.Music.ArtistFollower graphql”. But as the create action does not yet exist, this results in an error:

% mix ash.extend Tunez.Music.ArtistFollower graphqlCompiling 5 files (.ex)
== Compilation error in file lib/tunez/music.ex ==** (Spark.Error.DslError) [Tunez.Music.ArtistFollower]interfaces → interface → follow_artist:The interface of Tunez.Music.ArtistFollower refers to a non-existent action create(ash 3.5.37) lib/ash/code_interface.ex:11: Ash.CodeInterface.require_action/2(stdlib 7.0.2) erl_eval.erl:924: :erl_eval.do_apply/7(stdlib 7.0.2) erl_eval.erl:668: :erl_eval.expr/6(stdlib 7.0.2) erl_eval.erl:276: :erl_eval.exprs/6(spark 2.2.68) /Users/tim/src/tim/tunez/lib/tunez/music.ex:1: Spark.Dsl.before_compile/1

The book is not mentioning that and is then going on to iterate over the solution several times. I think this should be organised in a way where either no errors occur when following the editing recommendations or they should be mentioned and explained.

Also, edits for “change relate_actor …” and “policy action_type(:create) …” later on lack the change marks on the sidebar for which lines should be added.

First Post!

sevenseacat

sevenseacat

Author of Ash Framework

Ah that’s unfortunate, that we’ve missed a few of the marks for which lines to add :frowning: I thought I double and triple checked everything, but it seems I missed a few. Apologies for that!

Where Next?

Popular Pragmatic Bookshelf topics Top

jdufour
Hello! On page xix of the preface, it says there is a community forum "… for help if your’re stuck on one of the exercises in this book… ...
New
raul
Hi Travis! Thank you for the cool book! :slight_smile: I made a list of issues and thought I could post them chapter by chapter. I’m rev...
New
gilesdotcodes
In case this helps anyone, I’ve had issues setting up the rails source code. Here were the solutions: In Gemfile, change gem 'rails' t...
New
Chrichton
Dear Sophie. I tried to do the “Authorization” exercise and have two questions: When trying to plug in an email-service, I found the ...
New
swlaschin
The book has the same “Problem space/Solution space” diagram on page 18 as is on page 17. The correct Problem/Solution space diagrams ar...
New
brunogirin
When running tox for the first time, I got the following error: ERROR: InterpreterNotFound: python3.10 I realised that I was running ...
New
adamwoolhether
Is there any place where we can discuss the solutions to some of the exercises? I can figure most of them out, but am having trouble with...
New
taguniversalmachine
It seems the second code snippet is missing the code to set the current_user: current_user: Accounts.get_user_by_session_token(session["...
New
rainforest
Hi, I’ve got a question about the implementation of PubSub when using a Phoenix.Socket.Transport behaviour rather than channels. Before ...
New
davetron5000
Hello faithful readers! If you have tried to follow along in the book, you are asked to start up the dev environment via dx/build and ar...
New

Other popular topics Top

Devtalk
Hello Devtalk World! Please let us know a little about who you are and where you’re from :nerd_face:
New
AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
siddhant3030
I’m thinking of buying a monitor that I can rotate to use as a vertical monitor? Also, I want to know if someone is using it for program...
New
AstonJ
You might be thinking we should just ask who’s not using VSCode :joy: however there are some new additions in the space that might give V...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
PragmaticBookshelf
Create efficient, elegant software tests in pytest, Python's most powerful testing framework. Brian Okken @brianokken Edited by Kat...
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New

Sub Categories: