Ash Elixir

AE

Ash Elixir

Join the community to ask questions about Ash Elixir and get answers from other members.

Join

support

showcase

today-i-learned

Exception in transformer AshAuthentication.Strategy.Custom.Transformer

Hi there. I got an exception in transformer AshAuthentication.Strategy.Custom.Transformer when following the Authentication guide . Instead of User I set the resource name to Usuario. ```elixir...

Having some trouble with a custom policy

Hi! I'm using a custom policy like this: ```elixir policy action(:request_generation) do forbid_unless Scribble.Checks.ActorIsPayingOrTrialing...

Understanding "manage_relationship"

So I have a many_to_many relationship between the following resources. Reactant ```elixir defmodule Flame.App.Resources.Reactant do ......

Fragment with multiple 'from' items.

I'm trying to implement search similar to: https://leandronsp.com/a-powerful-full-text-search-in-postgresql-in-less-than-20-lines where the query looks like this: ``` SELECT courses.id,...

How to create a product with many_to_many tags?

Setup: ```elixir defmodule App.Shop.Product do [...]...

How to autoload a relationship?

The setup: lib/app/shop/resources/product.ex ```elixir defmodule App.Shop.Product do...

How to create a product with a category id?

The setup: lib/app/shop/resources/category.ex ```elixir defmodule App.Shop.Category do...

Correct way to refer to actor in custom validation?

Should we be directly reaching into changeset.context.private.actor? Seems janky.

AshPhoenix.Form fails to submit with Ash.Error.Query.InvalidFilterValue error

Hey there, I'm not sure exactly what is happenig, but I have a embedded resource that was inserted into my resource, when I try to update it via AshPhoenix, by first calling AshPhoenix.Form.remove_form and then AshPhoenix.Form.submit, I get this error: ```elixir [warning] Unhandled error in form submission for Marketplace.Markets.Property.update ...

AshAuthenticationPhoenix controlling generated routes

I setup my phoenix app using the getting started with ash authentication guide. If I understand correctly adding routes works as follows: ```elixir # Added for macros and functions use AshAuthentication.Phoenix.Router pipeline :browser do...

AshGraphql erroring with key :run not found

I think this is related to the new generic actions changes, but I ran into this after upgrading and pointing to the latest commit of ash_graphql: ``` [error] 0f997ea0-3e42-480e-a425-9d39d18f271f: Exception raised while resolving query. ...

Filter check is returning an error tuple, rather than filtering rows.

I'm trying to use policies to filter out rows whose visibility attribute is not 1. The table contains some rows where visibility == 2, so I expected the query will filter those out. ``` policy action_type(:read) do forbid_if Invisible...

AshPhoenix.Form fails in submit without errors with embedded resources

I have a embedded resource like this: ```elixir defmodule Marketplace.Markets.Property.OffMarket do @moduledoc false...

Issues using Ash.Type.Union

So I'm trying to use Ash.Type.Union and I keep getting errors when attempting to load the resource, I have defined an embedded resource ```elixir defmodule VMX.Transactions.TransactionData.Type.Call do...

Validate not nil, min and max for a string

The following validation code doesn't work: ```elixir attributes do uuid_primary_key :id...

What's the best way to learn Ash?

So i'm trying to learn ash, i don't want to just go through documentation. I want a better way to do it, but couldn't find courses that are up to date. I'm considering making a toy app, but not sure what's something that's beginner friendly and will help me gets the broadest exposure the Ash modules. I have considered making a to-do list, but in reality that'd expose me to maybe 10% of the framework....

Unexpected token during mix ash_phoenix.gen.live

I'm creating a toy application for tracking weight lifting workouts. I have a WeightType resource that I want to create a LiveView for. When running the Ash Phoenix LiveView generator I'm getting the following error and having trouble tracking down where it comes from so I can fix it. Help? `` mix ash_phoenix.gen.live Mitochex.Workouts Mitochex.Workouts.WeightType Would you like to name your actor? For example: current_user`. If you choose no, we will not add any actor logic. [Yn] n...

How To: Return a computed relationship in a read.

I have a resource like Posts. Each Post has a 'top comment'. So when i'm fetching a Post or list of Posts, I will like it to include the top comment like so: post.top_comment. I'm currently trying to use a preparation to load this relationship but not sure how to execute it on the Ash.Query side of things. Any ideas here would be appreciated!...

sort many_to_many

I thought I had asked this question before, but can't seem to find it... It seems like a very common use case, but not sure how to go about this. Is it possible to sort a many_to_many relationship based on a field in the join table....

Resource MyApp.Accounts.FriendLink is not present in any known Ash.Api module.

I'm getting the above warning even though this module is indeed listed in the registry. What am I missing? ``` defmodule MyApp.Accounts.Registry do use Ash.Registry,...