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!
3 Replies
And to clarify – if the
id
is provided and does not match an existing record – I want that to result in an error. If the id
is not provided at all, I want that to result in a "create". And if the id
is provided and does match an existing record, I want that to result in an "update". What's the recommended way of going about doing this? I initially had two separate mutations for two separate actions (create
and update
) but when I saw upsert? true
was an option – I wanted to take advantage of it.🤔 I think you need to do something a bit custom for that
Rad thank you Zach, I'm going to try it out