how do people write their delete mutation resolvers? (like in a graceful way, i feel there should be more than just telling the datastore to yeet the record and not tell the client about more info)
r
Ryan
05/25/2020, 10:19 AM
Hey @bob 👋
Could you elaborate more on your use-case?
Do you mean not deleting the records directly?
b
bob
05/25/2020, 4:12 PM
I mean just in general, when a query calls for a record to be removed from the database (deleting a user or a post) should there be some feedback to the client?
r
Ryan
05/25/2020, 4:49 PM
My personal approach firing the
delete
API in
try/catch
and then returning the deleted record on success and an error if fails or if the record is not found.