dblack
AEAsh Elixir
•Created by zorn on 8/17/2023 in #showcase
[VIDEO] Early thoughts on using Ash Framework to produce a GraphQL API.
Me too. I'm pretty settled with LiveView but my mind goes in circles and sometimes i wish for a separate js front end, mostly because of the choice of ui frameworks. But then I think what LiveView brings to the party... It's hard to beat
7 replies
AEAsh Elixir
•Created by zorn on 8/17/2023 in #showcase
[VIDEO] Early thoughts on using Ash Framework to produce a GraphQL API.
Yes really nice video, I look forward to seeing your svelte video
7 replies
AEAsh Elixir
•Created by Blibs on 8/8/2023 in #support
Ash.Query.filter creates filter with OR condition instead of AND
I recall having to wrap fragments in brackets under certain conditions, does doing
expr(fragment("(? %> ?)", "a", "a"))
help?11 replies
AEAsh Elixir
•Created by Dirigible on 8/8/2023 in #support
Filter by struct keys in a read action
there was some discussion over here: https://discord.com/channels/711271361523351632/799097774523547669/1034088336576491575
6 replies
AEAsh Elixir
•Created by Dirigible on 8/8/2023 in #support
Filter by struct keys in a read action
you may be able to use
get_path
on arguments, so your filter would look something like: filter expr(instance_type == get_path(^arg(:instance), [:machine_type]))
6 replies
AEAsh Elixir
•Created by Dirigible on 8/8/2023 in #support
Filter by struct keys in a read action
ie
:struct
atom for the type6 replies
AEAsh Elixir
•Created by Dirigible on 8/8/2023 in #support
Filter by struct keys in a read action
probably just a typo in your post, but should
argument :instance, struct
be argument :instance, :struct
?6 replies
AEAsh Elixir
•Created by michaelst on 8/3/2023 in #support
warning: Changeset has already been validated for action :create.
nice
16 replies
AEAsh Elixir
•Created by michaelst on 8/3/2023 in #support
warning: Changeset has already been validated for action :create.
sweet
16 replies
AEAsh Elixir
•Created by michaelst on 8/3/2023 in #support
warning: Changeset has already been validated for action :create.
yeah i'd wait for confirmation on that!
16 replies
AEAsh Elixir
•Created by michaelst on 8/3/2023 in #support
warning: Changeset has already been validated for action :create.
16 replies
AEAsh Elixir
•Created by michaelst on 8/3/2023 in #support
warning: Changeset has already been validated for action :create.
You could push this up to the resource with a default MFA. default MFAs (i'm pretty sure) only get called on submit
16 replies
AEAsh Elixir
•Created by lpmay on 7/18/2023 in #support
Confused about `one_of` vs `attribute_equals`
Not 100% sure but maybe
before_action
operates only on the changeset? You'd use it to modify the changeset before running the action36 replies
AEAsh Elixir
•Created by lpmay on 7/18/2023 in #support
Confused about `one_of` vs `attribute_equals`
I think I might have sent you on a bum steer with before_action, that's probably not useful for this example
36 replies
AEAsh Elixir
•Created by lpmay on 7/18/2023 in #support
Confused about `one_of` vs `attribute_equals`
Yeah I believe that's the case for
one_of
... The doco indicates attribute_equals
validates the changeset then the resource if that field isn't getting changed in the changeset36 replies
AEAsh Elixir
•Created by lpmay on 7/18/2023 in #support
Confused about `one_of` vs `attribute_equals`
So yeah the difference between attribute_equals and one_of is subtle... one_of seems to check for changes to an attribute or argument already passed to the changeset, and passes if that attribute hasn't yet changed. In your example above
:role
hasn't yet changed so it always passes36 replies
AEAsh Elixir
•Created by lpmay on 7/18/2023 in #support
Confused about `one_of` vs `attribute_equals`
36 replies
AEAsh Elixir
•Created by lpmay on 7/18/2023 in #support
Confused about `one_of` vs `attribute_equals`
and attribute_equals uses
get_attribute
: https://github.com/ash-project/ash/blob/v2.11.11/lib/ash/resource/validation/attribute_equals.ex#L3336 replies
AEAsh Elixir
•Created by lpmay on 7/18/2023 in #support
Confused about `one_of` vs `attribute_equals`
one_of uses
fetch_argument_or_change
: https://github.com/ash-project/ash/blob/v2.11.11/lib/ash/resource/validation/one_of.ex#L36C24-L36C2436 replies
AEAsh Elixir
•Created by lpmay on 7/18/2023 in #support
Confused about `one_of` vs `attribute_equals`
seems like they both use different functions to get the value from the changeset
36 replies