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

jeffmcompsci
Title: Design and Build Great Web APIs - typo “https://company-atk.herokuapp.com/2258ie4t68jv” (page 19, third bullet in URL list) Typo:...
New
simonpeter
When I try the command to create a pair of migration files I get an error. user=> (create-migration "guestbook") Execution error (Ill...
New
edruder
I thought that there might be interest in using the book with Rails 6.1 and Ruby 2.7.2. I’ll note what I needed to do differently here. ...
New
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
AleksandrKudashkin
On the page xv there is an instruction to run bin/setup from the main folder. I downloaded the source code today (12/03/21) and can’t see...
New
cro
I am working on the “Your Turn” for chapter one and building out the restart button talked about on page 27. It recommends looking into ...
New
jskubick
I’m under the impression that when the reader gets to page 136 (“View Data with the Database Inspector”), the code SHOULD be able to buil...
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
dachristenson
I just bought this book to learn about Android development, and I’m already running into a major issue in Ch. 1, p. 20: “Update activity...
New
dachristenson
@mfazio23 Android Studio will not accept anything I do when trying to use the Transformations class, as described on pp. 140-141. Googl...
New

Other popular topics Top

wolf4earth
@AstonJ prompted me to open this topic after I mentioned in the lockdown thread how I started to do a lot more for my fitness. https://f...
New
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
New
Help
I am trying to crate a game for the Nintendo switch, I wanted to use Java as I am comfortable with that programming language. Can you use...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
CommunityNews
A Brief Review of the Minisforum V3 AMD Tablet. Update: I have created an awesome-minisforum-v3 GitHub repository to list information fo...
New
AstonJ
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New
RobertRichards
Hair Salon Games for Girls Fun Girls Hair Saloon game is mainly developed for kids. This game allows users to select virtual avatars to ...
New

Sub Categories: