Is there a way in the request pipeline to skip the...
# prisma-whats-new
a
Is there a way in the request pipeline to skip the write and return a custom response? I see that I can technically return a value in the error message but I was wondering if there was a more efficient way
a
Right, I was more wondering if a response could be returned that wasn't inside the error object. I'm trying to return an actual response from a separate query made inside the pipeline, to be used with nested mutations. Still tackling upsert with nested mutations where the nested part will either move forward with the pipeline if it doesnt already exist but if it does, it will skip the write step and return the existing id to the mutation
a
Well, you know if the nested part already exists on the client, because it has an ID right?
and a new nested item would not
So you can decide on the client if you want to do a
myTypeid: "_ID_"
or
myType: { field: value, ...}
a
Right now the nested part does not always have an ID even if it exists, however it does have a different unique field
a
That doesn't help (yet)
a
So I guess now the problem is that I believe currently you can't connect a relation with any unique field other than ID
a
No, I created the FR for that...
a
Just upvoted it 👍
👍🏻 1