Ash Framework

AF

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.

Join

support

showcase

today-i-learned

GraphQL :type, prefix based on Context?

In the example docs, we have something like the following: ``` defmodule Helpdesk.Support.Ticket do ...omitted......

Preload relationship during action

I know we can use load to load an association during an action. However this only loads the relationship after the action is completed. I would like to do something like this: ```elixir action :update do change set_attribute(:starts_at, DateTime.utc_now(), new?: true)...

Cannot return null for non-nullable field

Hi Guys, I have an attribute in a resource that is a jsonb object in postgres and am defaulting it to an empty object in the db and also want to return it as an emoty object in GraphQL. However it seems to be returning null if the the object is empty... Is this something AshGraphQL is doing under the hood?...

Error while building reference

I'm trying to use the attributes of a relationship in a calculation but I get a runtime error. I attached my code and the error as a screenshot because Discord somehow prevents me from creating posts with more than 2000 characters.
No description

pub_sub compilation issue

After updating to ash main, commit id: 2813b3c9b2f45d1aec6aff2a64920404a42ac839 I'm getting the following error on compilation related to pub_sub Given this line in a pub_sub: publish :create, ["changed", :parent_id, [:id, nil]]...

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...