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

mikecargal
Title: Hands-on Rust: question about get_component (page 295) (feel free to respond. “You dug you’re own hole… good luck”) I have somet...
New
raul
Page 28: It implements io.ReaderAt on the store type. Sorry if it’s a dumb question but was the io.ReaderAt supposed to be io.ReadAt? ...
New
alanq
This isn’t directly about the book contents so maybe not the right forum…but in some of the code apps (e.g. turbo/06) it sends a TURBO_ST...
New
jeremyhuiskamp
Title: Web Development with Clojure, Third Edition, vB17.0 (p9) The create table guestbook syntax suggested doesn’t seem to be accepted ...
New
New
leonW
I ran this command after installing the sample application: $ cards add do something --owner Brian And got a file not found error: Fil...
New
curtosis
Running mix deps.get in the sensor_hub directory fails with the following error: ** (Mix) No SSH public keys found in ~/.ssh. An ssh aut...
New
kolossal
Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New
jwandekoken
Book: Programming Phoenix LiveView, page 142 (157/378), file lib/pento_web/live/product_live/form_component.ex, in the function below: d...
New
ggerico
I got this error when executing the plot files on macOS Ventura 13.0.1 with Python 3.10.8 and matplotlib 3.6.1: programming_ML/code/03_...
New

Other popular topics Top

AstonJ
What chair do you have while working… and why? Is there a ‘best’ type of chair or working position for developers?
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
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
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
AstonJ
If you are experiencing Rails console using 100% CPU on your dev machine, then updating your development and test gems might fix the issu...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
New
sir.laksmana_wenk
I’m able to do the “artistic” part of game-development; character designing/modeling, music, environment modeling, etc. However, I don’t...
New

Sub Categories: