
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
Ah that’s unfortunate, that we’ve missed a few of the marks for which lines to add I thought I double and triple checked everything, but it seems I missed a few. Apologies for that!
Popular Pragmatic Bookshelf topics










Modern front-end development for Rails, second edition - Struggling to get the first chapter to work
Other popular topics









Categories:
Sub Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /rails
- /js
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /emacs
- /haskell
- /java
- /onivim
- /typescript
- /svelte
- /crystal
- /kotlin
- /c-plus-plus
- /tailwind
- /gleam
- /react
- /ocaml
- /flutter
- /elm
- /vscode
- /ash
- /html
- /opensuse
- /centos
- /php
- /deepseek
- /zig
- /scala
- /sublime-text
- /lisp
- /textmate
- /nixos
- /debian
- /react-native
- /agda
- /kubuntu
- /arch-linux
- /revery
- /django
- /ubuntu
- /spring
- /manjaro
- /nodejs
- /diversity
- /lua
- /julia
- /c
- /slackware
- /markdown