shyan
shyan
AEAsh Elixir
Created by shyan on 7/14/2023 in #support
How to make fields optional for graphql api?
Kind of analogous to the way hide_fields is used, is there a way I can allow a field to be nil for the Graphql API when it is not allowed to be nil as an attribute?
10 replies
AEAsh Elixir
Created by shyan on 6/29/2023 in #support
Looking for an example of an attribute-based custom filter check I once saw in an error message.
I saw once it in an error message, but can't find it anywhere online. It would correspond to this passage in the documentation, for create actions:
Keep in mind that, for create actions, many expr/1 checks won’t make sense, and may return false when you wouldn’t expect. Expression (and other filter) policies apply to “a synthesized result” of applying the action, so related values won’t be available. For this reason, you may end up wanting to use other checks that are built for working against changesets, or only simple attribute-based filter checks. Custom checks may also be warranted here.
Keep in mind that, for create actions, many expr/1 checks won’t make sense, and may return false when you wouldn’t expect. Expression (and other filter) policies apply to “a synthesized result” of applying the action, so related values won’t be available. For this reason, you may end up wanting to use other checks that are built for working against changesets, or only simple attribute-based filter checks. Custom checks may also be warranted here.
3 replies
AEAsh Elixir
Created by shyan on 6/26/2023 in #support
Ash Graphql "create" mutation with upsert? true – how to use ID as argument for upsert identity?
I have a Graphql create mutation within which upsert? true and upsert_identity :id. I have an action corresponding to this (code below). Can I get id to be an acceptable input to this mutation? Thanks!
mutations do
create :upsert_patient, :upsert_patient, upsert?: true, upsert_identity: :id
end
mutations do
create :upsert_patient, :upsert_patient, upsert?: true, upsert_identity: :id
end
create :upsert_patient do
upsert? true
upsert_identity :id
end
create :upsert_patient do
upsert? true
upsert_identity :id
end
5 replies