Hi there, I'm seeking some advice on how to use WriteRelationship in an API that expects a 204 when the relationship already exists. Currently, if the request to WriteRelationship with RelationshipUpdate_OPERATION_TOUCH succeeds, we return the request, rather than re-fetch the relationship after it's been created (since WriteRelationship returns only WrittenAt). However, I need to update this such that we return an empty response, 204, when the relationship already exists.
There are two approaches I can think of. 1) Use RelationshipUpdate_OPERATION_CREATE, and catch the
AlreadyExists
error thrown by WriteRelationship. 2) Query for the relationship before trying to create, and return 204 if it already exists.
Are there any recommendations from folks here?