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

I18n within resources

Hi! Is there a way to replicate the functionality of something like Trans (https://hexdocs.pm/trans/Trans.html) in Ash? It provides a simple way to translate fields of a schema without needing extra db tables and joins. What is the idomatic way to handle I18n within resources in Ash?...

ash json api don't work with aggregates

I have a resource that has this aggregate: ```elixir aggregates do first :last_bid_price, :bids, :price do sort inserted_at: :desc...

Is it possible to auto generate an Ash Resource from a JSON Schema?

Hi, I took a deep dive into the FHIR specification and I thought this is a great fit for the Ash Framework. The core specification consists of > 100 resources and it's a little bit laborious to handcode everything. Is there a way to parse a JSON Schema and automatically create the Ash resources?...

Problem with override image

Do not get this to work - the standard Ash image is still there... also, is there it a spec of all the overrides? ```elixir sign_in_route overrides: [ AmplDevWeb.AuthOverrides, AshAuthentication.Phoenix.Overrides.Default...

Adding elixir_sense to mix.exs seems to break autocomplete

Hi folks, I setup a new Ash project tonight, following the documentation for AshAuthentication. I added elixir_sense to mix.exs but this seems to be breaking autocomplete and other LSP functions. In case there is some difference between nvim and VS Code I tried both, but have the same issue. In the LSP logfile that nvim generates I see: ```...

Best practice to implement dynamic filtering for a read action?

Let's say I have a page that shows a bunch of products for sale. Now I want to start giving the user options for him to filter some of the products, let's say by department, by mix and/or max price, date, etc. Not only that but I also want to being able to sort by different fields (ex: price, date)....

Calculations and AshPhoenix.Form

First post! So thanks @Zach Daniel for this awesome library. Looks really promising! I'm working on a side project where I have to store employee contracts. For each contract I store the employment (as factor between 0 and 1) and the number of vacation days per year (when working full time). ```elixir...

AshAdmin not working with umbrella and Phoenix 1.7.0-rc.2

I'm not sure if it is that my project is separated in a umbrella (with phoenix in one app and the resources in another) or if it is just that I'm using Phoenix 1.7.0-rc.2, but when I access the AshAdmin route, I get a blank page and no error in the terminal (see image) I just added it using the AshAdmin readme steps. I also had to add phoenix_view to my deps since AshAdmin requires it but Phoenix 1.7 doesn't have it anymore. I also have all my ash_apis in both apps configs....
No description

flat file json or yml data layer

I have a very deeply nested JSON object that we think might be really nice to wrap a GraphQL query API over. Unless I missed it, I don't see data layers similar to the CSV data layer that are targeting flat files in JSON/YML but I think the example of the CSV data layer would be a good starting spot in terms of seeing what needs to be implemented for the behavior. I only really need to support read/query actions, and ideally I'd like to provide the data from the previous GQL field as the context for any child fields. I'm pretty sure I could devise a pretty quick strategy for this in Absinthe just based on dated but previous experience but I'm attracted to the resource model of ash and some of the adjacent functionality I could implement around the GQL API....

Add default values in AshPhoenix.Form.for_create

Is it possible to setup default values for some fields of a resource during the AshPhoenix.Form.for_create form creation function? For example, let's say I'm already in live_view that knows some id that needs to be set in the resource, I don't want to expose that field in the form but set it directly in the backend....

Custom Statements

Hi I have a question How do I do the following ```elixir...

undefined function not_found_error?/1 in read action

I have this read action: ``` read :last_own_bid do get? true...

AshAuthentication not working with Phoenix in umbrella

I just followed this guide https://ash-hq.org/docs/guides/ash_authentication_phoenix/latest/tutorials/getting-started-with-ash-authentication-phoenix trying to make ash authentication work. The major difference is that I'm using an umbrella project, so the resources are in one app (Marketplace) and the web (phoenix) stuff in another app (MarketplaceWeb), but the rest is pretty much the same. If I try to access the root route (which uses the guide minimal html) I will get a key :current_user not found in ......
No description

Autoload an aggregation, relationship or calculation in a read action

I have a read action where I want to return the data with some aggregation/relationship/calculation data already computed instead of returning #Ash.NotLoaded<> in these fields and having to manually run the load function to load them. I can't find in the documentation how to do that...

Need to duplicate migration_defaults if multiple resources uses the same table

I have a resource called User it has this postgres configuration: ```...

Convert resources that uses the same table

In my system I have two separated Apis/Contexts, Accounts and Actions. In Accounts I have a User resource where I handle authentication, etc. In Auctions I have a Bidder resource which I use to identify a bidder in a auction. ...

set user_id field with actor id during create action

I have a resource that has the following relationship: ``` relationships do belongs_to :user, Accounts.User do...

Changing SignIn submit button label

Hi, I am trying to offer a auth experience in French by setting the right overrides (let me know if you think the approach is wrong BTW). Turns out the label submit button for the SignIn form does not appears in overrides. Am I looking at the wrong component? Is there another way to change the label? Should it be added to overrides? Cheers...

Additional attributes in many-to-many relations

Hi there, I'm using a many-to-many relation between two resources. The resources Ingredient and Store are related through the resource Price (an ingredient is available at a store for a certain price). The Price resource has the additional attributes :amount and :price. ...

Are Ecto.Multi or something equivalent supported in Ash?

Can I use Ecto.Multi or something equivalent to create more complex database queries inside a transaction using multiple resources?