Oliver
Oliver
AEAsh Elixir
Created by ZachDaniel on 5/20/2025 in #showcase
Ash Weekly: Issue #17 | Ash AI Launched, ElixirConf EU Wrapped, thoughts on the Contributors Summit
I am always super inspired and want to crank out a thousand interesting things after each conference, but I agree 100% that this year was something special
3 replies
AEAsh Elixir
Created by ZachDaniel on 5/20/2025 in #showcase
Ash Weekly: Issue #17 | Ash AI Launched, ElixirConf EU Wrapped, thoughts on the Contributors Summit
Forgot we can chat about it here 😛 Wrote in #ai channel:
Zach articulated my feelings on AI and ash quite nicely in the newsletter, Ash is almost like a super power for LLM generated code in elixir land because it is one of thew few (only?) ways to enforce typesafety and "keep the shape of things similar" on top of AI generated code I shudder at the thought of how many NIH flavours of code an LLM could produce across X teams
3 replies
AEAsh Elixir
Created by Oliver on 5/19/2025 in #support
How to ergonomically add/remove to an array of embedded resource in graphql
Aha, when its an embedded resource you can just put it straight in as the type for the argument apparently... I thought that wasnt working.. has something changed?
14 replies
AEAsh Elixir
Created by Oliver on 5/19/2025 in #support
How to ergonomically add/remove to an array of embedded resource in graphql
using:
update :add_diagram_area do
argument :diagram_area, :struct do
allow_nil? false
constraints instance_of: DiagramArea
end
end
update :add_diagram_area do
argument :diagram_area, :struct do
allow_nil? false
constraints instance_of: DiagramArea
end
end
14 replies
AEAsh Elixir
Created by Oliver on 5/19/2025 in #support
How to ergonomically add/remove to an array of embedded resource in graphql
it just ends up as JsonString
14 replies
AEAsh Elixir
Created by Oliver on 5/19/2025 in #support
How to ergonomically add/remove to an array of embedded resource in graphql
The main issue right now is that embedded types do not create proper input types
14 replies
AEAsh Elixir
Created by Oliver on 5/19/2025 in #support
How to ergonomically add/remove to an array of embedded resource in graphql
that is actually what the legacy graphql does I see now so yeah
14 replies
AEAsh Elixir
Created by Oliver on 5/19/2025 in #support
How to ergonomically add/remove to an array of embedded resource in graphql
the custom update you mean is to have an arg foo and do a custom change and return the parent?
14 replies
AEAsh Elixir
Created by Oliver on 5/19/2025 in #support
How to ergonomically add/remove to an array of embedded resource in graphql
the embeds do have keys, thats how I implement the deletes
14 replies
AEAsh Elixir
Created by pcharbon70 on 5/16/2025 in #showcase
AshCommanded: Declarative CQRS and ES patterns for Ash
Can't wait for the lengthy discussion on elixirforum on whether or not this is real CQRS or not 😂 Congrats on the release @pcharbon70 !
12 replies
AEAsh Elixir
Created by Oliver on 5/13/2025 in #support
Error message in a grapqhl mutation
I will make an issue to see if we can make this error message more meaningful
11 replies
AEAsh Elixir
Created by Oliver on 5/13/2025 in #support
Error message in a grapqhl mutation
Thank you
11 replies
AEAsh Elixir
Created by Oliver on 5/13/2025 in #support
Error message in a grapqhl mutation
Ahhhhh yes I am pointing a create at it
11 replies
AEAsh Elixir
Created by Oliver on 5/13/2025 in #support
Error message in a grapqhl mutation
I have identical code in another resource, only the argument input type differs
11 replies
AEAsh Elixir
Created by Oliver on 5/13/2025 in #support
Error message in a grapqhl mutation
From type:
defmodule Safari.Types.SupplementalDocumentnitialInput do
@moduledoc false
use Ash.Type.NewType,
subtype_of: :map,
constraints: [
fields: [
note: [type: :string, allow_nil?: true],
outcrop_id: [type: :integer, allow_nil?: true],
study_id: [type: :integer, allow_nil?: true]
]
]

def graphql_input_type(_), do: :supplemental_document_initial_input
end
defmodule Safari.Types.SupplementalDocumentnitialInput do
@moduledoc false
use Ash.Type.NewType,
subtype_of: :map,
constraints: [
fields: [
note: [type: :string, allow_nil?: true],
outcrop_id: [type: :integer, allow_nil?: true],
study_id: [type: :integer, allow_nil?: true]
]
]

def graphql_input_type(_), do: :supplemental_document_initial_input
end
Used as such
action :create_graphql, Safari.Types.SafariFileUploadInfo do
argument :note, Safari.Types.SupplementalDocumentnitialInput, allow_nil?: false

run fn %{
arguments: %{
note: note
}
},
%{actor: actor} ->
params =
note
|> Map.put(:file_data, %{category: "model", public: false})

__MODULE__.create(params, load: [file: :upload_url], actor: actor)
|> case do
{:ok, sd} ->
{
:ok,
sd.file.upload_url
}

other ->
other
end
end
end
action :create_graphql, Safari.Types.SafariFileUploadInfo do
argument :note, Safari.Types.SupplementalDocumentnitialInput, allow_nil?: false

run fn %{
arguments: %{
note: note
}
},
%{actor: actor} ->
params =
note
|> Map.put(:file_data, %{category: "model", public: false})

__MODULE__.create(params, load: [file: :upload_url], actor: actor)
|> case do
{:ok, sd} ->
{
:ok,
sd.file.upload_url
}

other ->
other
end
end
end
11 replies