Ash Framework
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.
JoinAsh Framework
The Elixir backend framework for unparalleled productivity. Declarative tools that let you stop wasting time. Use with Phoenix LiveView or build APIs in minutes for your front-end of choice.
JoinSeeding multiple resources with inter-relationships
How do you set an attribute to the join resource when creating?
User
and an Org
, joined by a many_to_many
through a Join Resource UserOrg
.
UserOrg
has an attribute :role
. How do I set the role
on the UserOrg
when creating an Org
?
```elixir...AshAdmin Liveview is crashing
Pagination 'count' is not accurate if the SQL query result contains duplicate id's
DISTINCT
like this:
SELECT coalesce(count(DISTINCT t0."id"::bigint), $1::bigint)::bigint FROM (...) ...
SELECT coalesce(count(DISTINCT t0."id"::bigint), $1::bigint)::bigint FROM (...) ...
id
s then the count doesn't reflect the actual number of rows returned by the sub query because DISTINCT
is removing them from the count....Found read action while expecting an action of type relationship...
relationship(:events, :events_by_extid)
:
** (ArgumentError) Found an action of type read while looking for an action of type relationship
The message itself is pretty obvious, but I can’t find a definition of how a relationship
action would look like… 😇...Override/Extend AshAuthentication Sign in
handle_success
callback, but don't know where to put the other implementations. Thank you."Could not relate to actor, as no actor was found (and :allow_nil? is false)"
change relate_actor(author)
which causes the above error when trying to seed some data with Tweet.create
. Is there a way to use this action as is for the seeding (without creating another action without relate_author
)?Pass create changeset or inputs from it to Flow?
Create a custom migration file
Integrate Oban to a flow
How can I add the flow actor as the actor of one of the steps?
Which action to use to update/delete multiple rows at the same time?
Post
, and I want to have an action where I update all posts from that user.
At first glance, I would use the :update
action for that. But it seems that both :create
, :update
and :destroy
actions are only meant to run with only one resource/changeset at a time....Rename the `result(s)` field if a GraphQL mutation output
result
or results
field (see image).
Is there some way to me to customize that name without having to create the whole mutation by hand?
For example, in the case of the image, I would like that instead of result
the key would be offer
...
Load data from id for a policy check during a create action
Offer
, that offer needs to be related to a Property
, so one of the fields I accept as input is a property_id
.
In my policies, I need to check some of this property fields, meaning that I need to load that property and make it accessible to that action policies somehow.
How can I do such a thing with Ash?...Differences between ETS and Postgres
pre_check_with
. However, are there some major differences where Ash is not able to abstract away the data layer and the code would actually be different for the two?
I just wanted to keep open the option of selecting a database later. Maybe PlanetScale (which is MySQL, but doesn't support foreign key constraints and has some other limitations too), or Postgres or SQLite. Of course I understand we'll have to figure out how to create a data layer for those as they don't exist in Ash right now, but maybe I could help with one of those if we decide to go that route?...GraphQL query of resource stops working after upsert of it
My AshGraphql journey
Using encrypted email field with Ash Authentication
encrypted_email
field the same way you have encrypted_name
or encrypted_address
with ash_authentication
?
Having the e-mail
field not encrypted in the database really bothers me tbh....How to create a partial index with Ash?