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.
JoinDifferences between UUID primary keys in Ecto vs Ash
uuid_primary_key
unwraps into:
```elixir
attribute :id, :uuid do
writeable? false
default &Ash.UUID.generate/0...Starting a Phoenix/Ash project with minimal cruft
Check a policy manually
How to insert a record with its nested children?
Ash dropping FilterCheck if there's `authorize_if always()`
authorize_if MyApp.FilterByActorId
authorize_if always()
authorize_if MyApp.FilterByActorId
authorize_if always()
How do relationships with composite keys work?
Policy checks on related resources
Using manage_relationship to delete a related record
type: :remove
option, Ash responds with Invalid value provided for notes: changes would create a new related record.
Is this the right approach? Or should I manually delete the record?Confused about `one_of` vs `attribute_equals`
:verify
action on a resource, which I only want to run on resources which have :role
set to :unverified
The below works as expected (produces valid/invalid changesets as expected):
```
update :verify do #custom action to verify an unverified user
validate attribute_equals(:role, :unverified) #only verify unverified users
change set_attribute(:role, :verified)...Calculatated fields and AshGraphQL
Bypass not applying - had to pass actor again in load
load!
call.
not sure if there's a better way to do this type of thing but this is what's working now:...AshJsonApi + Managed Relationships
Can You Add Additional Attributes to ash_authentication_phoenix?
role
attribute to my user resource so I did the below:
```
attributes do
uuid_primary_key :id
attribute :email, :ci_string, allow_nil?: false...How to determine if the current page is the last or first page in Keyset pagination
Full debug SQL
AshPostgres.DataLayer.run_aggregate_query/3, at: lib/data_layer.ex:738
A long enough sql would be truncated. How do I get the full sql without truncation?
Thanks!...Setting defaults for a form input that is an argument and not an attribute?
default
option for an action argument; however, It accepts a zero-argument function, so there's no way to get the resource being updated.
I explored using the prepare_params
option for AshPhoenix.Form.for_update
but I couldn't find any examples. It's arrity 2 and receives the params but is only called when the form is validated or submitted....How to make fields optional for graphql api?
hide_fields
is used, is there a way I can allow a field to be nil
for the Graphql API when it is not allowed to be nil
as an attribute?Understanding value_is_key option when managing relationships
many_to_many exception after updating Ash
2.6.31
. I updated to 2.11.8
today and an existing many_to_many
association that I had is now raising an exception. Did something change?
Here are my resources:
```elixir...How to programatically add a policy to a resource?