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

Complex types (postgres)

Is it possible to create (and use) complex types like this ```postgres CREATE DOMAIN dow AS integer CHECK( value BETWEEN 1 and 7...

Postgres' range types

What's the best approach for adding tstzrange type column to a resource?

add_tag but unique

A product has a many_to_many relationship to a tag (via a product_tag resource).
lib/app/shop/resources/product.ex ```elixir [...]...

How to add_tag? Managing Relationships

I try to adapt https://ash-hq.org/docs/guides/ash/latest/topics/managing-relationships for an application where a product which has a many_to_many relationship to tags. lib/app/shop/resources/product.ex ```elixir defmodule App.Shop.Product do...

many_to_many update problem

I have a product which has many_to_many tags. Creating works. Updating doesn't. Here's the resource code: lib/app/shop/resources/product.ex ```elixir defmodule App.Shop.Product do...

Identity on `attribute :some_attribute, {:array , EmbeddedResource}`

So if I have the following resource. ```elixir defmodule Resource do ... actions do...

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.