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

Default value for {:array, :atom} attribute

Hello, I'm trying to have a default value when using an {:array, :atom} attribute like this: ```...

Ash Resources with Ecto Multi

I'm using commanded, an event sourcing library for a learning project I'm on. Making read model projections in commanded work via a function that returns an ecto multi. How can I use Ash resources with Ecto multis?...

Relationship expects Destination Field

I'm sure this is so basic but I keep running into this when adding relationships. I haven't tried anything very complicated.. just adding simple has_one relationships. I keep getting: ``` [{...

Recursive Flows

Hi I'm trying to right a flow that runs itself given a condition. ```elixir defmodule Demo.Inventory.Flows.Search do @moduledoc """...

Relations with GraphQL

I want to make a simple belongs_to relationship. I tried so many things but I can almost never even compile it. :/ I'm not looking to debug anything, I just can't get it from the documentation. I even tried searching for :ash_graphql usages in the wild with GitHub Code Search. How do I wire this up with GraphQL?

postgres function undefined

Setup of AshPostgres is not going well this time, I am getting the following error:
** (CompileError) lib/zenvtc/accounts/resources/user.ex:4: undefined function postgres/1 (there is no such import)
** (CompileError) lib/zenvtc/accounts/resources/user.ex:4: undefined function postgres/1 (there is no such import)
The offending file looks like this:...

Calculate only on a read action

Hello everyone. Just starting out with Ash and so far, so good. I'm starting to figure a few things out. What I'm currently struggling with is having a calculate only run on a read action. I have an embedded resource where I'm using a calculate to generate a URL from another field. Here is a snippet from parent resource where the embedded is loaded: ```elixir...

Array of Arrays argument

Should it be possible to create an argument of type {:array, {:array, :integer}}? Right now I'm getting a compile error. ``` ** (KeyError) key :type not found in: [min_length: [type: :non_neg_integer, doc: "A minimum length for the items"], items: [type: :any, doc: "A schema for individual items"], max_length: [type: :non_neg_integer, doc: "A maximum length for the items"], nil_items?: [type: :boolean, doc: "Whether or not the list can contain nil items", default: false], empty_values: [type: {:list, :any}, doc: "A set of values that, if encountered, will be considered an empty list.", default: [""]]] (elixir 1.14.3) lib/keyword.ex:1115: Keyword.update!/4...

How do we seed data of a specific resource?

I want to add admin user by default through seeds

Postgres Citext?

Trying to setup Ash Authentication and have gone through the getting started in the docs. Now running into this error when trying to run migrations. ``` 15:12:01.856 [info] create table users ** (Postgrex.Error) ERROR 42704 (undefined_object) type "citext" does not exist (ecto_sql 3.9.2) lib/ecto/adapters/sql.ex:913: Ecto.Adapters.SQL.raise_sql_call_error/1...

Setting Tenant when using Context Multitenancy

So I have configure my resources to use context multitenancy (Postgres Schemas). Migrations are working fine and creating an org creates an org schema as well. My question is how can I set the tenant, assuming am getting the tenant from the subdomain, which can the be used in Ash queries? I have seen Ash.set_tenant/1 which takes a map as argument, what does the map look like? How is it different from Ash.Query.set_tenant/2? An also there what's called Process Context is Ash, what...

updating password through ash resources

trying to update the password but current_password field data vanishes as soon as i enter the data in new_password. the current_password field vanishes

Update Name through Ash resources.

Trying to update the name through ash resources.

Ash HQ User Settings Page

```elixir prop(current_user, :map, required: true) data(email_form, :map) data(password_form, :map)...

Confirm with password

I want to perform deletion upon password confirmation. Any suggestions on how i can do that?

AshAuthentication Errors

After I've updated ash packages: ``` ash 2.5.9 => 2.5.12 ash_authentication 3.7.3 => 3.7.5...

Ecto.Repo.insert! compatibility issue as of ash v2.5.10

I noticed some of my tests failing after upgrading to the latest ash, relating to the work recently done to add relationships to the underlying ecto schemas. Please see https://github.com/ahey/ash_postgres/commit/acc947292d2aa1e4a9ffccaf4d63069cf6c82a90 for details and a test case.

adding data to the junction table

How can i add data to a junction/pivot table through a form? I have create action enabled on the junction table...

Use secret_key_base as token_signing_secret

I have the following code in lib/example/accounts/user.ex: ```elixir tokens do enabled? true...

Delete Queries.

How does delete queries work? like if i want to fetch a record based on and id or maybe two columns and want to delete that record?