Upsert - [GraphQL] Error: undefined argument
Hi all. I'm trying to upsert shopifyBulkOperation records, but I'm getting the error [GraphQL] Error: undefined argument. I'm not sure what I'm missing here?

14 Replies
Hello,
You need to pass the
on
option in order for us to know on what field to base the upsert. Unless you're trying to upsert on the id
Could you please share the traceId for the error?
Do you have more than one unique field on the model/a unique field with scoped by?
I'm not able to reproduce this on my end@Chocci_Milk I've tried, same result. Other than the shopify fields, the only extra field is a "belongs to" relationship with another model (localBulkOperation)
Traceid: 1fd51b9a31ff4fdcba4cbb28be09a66b

From what I can tell, the error is saying that you're missing a field that looks to be required. I just can't figure it out. Let me dig a tiny bit
If you have an ID, why can't you just use the update action?
Thats a thought but I want to get to the bottom of why this is happening
Its weird cause my logs say that this action is a background action and global action but I don't see that being the case in your code
@Chocci_Milk it's being called from a global action - bulkGeneration/createShopifyBulkOperation
@ljspoor94 the reason is that this is called after I send a mutation to Shopify to create a bulk operation, which gives me the operation ID. So the create webhook might or might not have arrived to create the record yet
Are you enqueuing that global action?
Yes
Mind if I run the upsert on your api playground myself?
Sure, go ahead
Do you mind if I try converging your Shopify connection? It will bring back deleted fields
Idk, if you have deleted fields in the past
If it only affects the bulk-refactor environment, no problem at all
Nope, didn't change a thing
Ok, I just found that the create/update actions work. Would you be able to run your own upsert logic for the time being? Check that the value exists and run create/update accordingly
I think that there's an issue with the upsert API
I've made a ticket and sent it over to one of our engineers. Sorry for the inconvienience
Ok no problem. Please let me know once it's fixed so I can update the code