You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+126Lines changed: 126 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -747,6 +747,132 @@ body = ClientWriteRequest(
747
747
748
748
response =await fga_client.write(body, options)
749
749
```
750
+
###### Conflict Options
751
+
752
+
OpenFGA v1.10.0 introduced support for write conflict options to handle duplicate writes and missing deletes gracefully. These options help avoid unnecessary error handling logic in client code.
753
+
754
+
**Available Options:**
755
+
756
+
-`on_duplicate` - Controls behavior when writing a tuple that already exists:
757
+
-`ERROR` (default): Returns an error if an identical tuple already exists
758
+
-`IGNORE`: Silently ignores duplicate writes (treats as no-op)
759
+
760
+
-`on_missing` - Controls behavior when deleting a tuple that doesn't exist:
761
+
-`ERROR` (default): Returns an error if the tuple doesn't exist
762
+
-`IGNORE`: Silently ignores deletes of non-existent tuples (treats as no-op)
763
+
764
+
**Example: Ignoring duplicate writes**
765
+
766
+
```python
767
+
# from openfga_sdk import OpenFgaClient
768
+
# from openfga_sdk.client.models import ClientTuple, ClientWriteRequest
769
+
# from openfga_sdk.client.models.write_conflict_opts import (
0 commit comments