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
With OpenFGA [v1.10.0](https://github.com/openfga/openfga/releases/tag/v1.10.0) and later, support for write conflict options to handle duplicate writes and missing deletes gracefully has been added.
753
+
OpenFGA v1.10.0+ supports conflict options for write operations to handle duplicate writes and missing deletes gracefully.
754
754
755
-
**Example: Ignoring duplicate writes**
756
-
757
-
```python
758
-
# from openfga_sdk import OpenFgaClient
759
-
# from openfga_sdk.client.models import ClientTuple, ClientWriteRequest
760
-
# from openfga_sdk.client.models.write_conflict_opts import (
on_duplicate_writes=ClientWriteRequestOnDuplicateWrites.IGNORE,# Available options: ERROR, IGNORE
770
+
on_missing_deletes=ClientWriteRequestOnMissingDeletes.IGNORE,# Available options: ERROR, IGNORE
843
771
)
844
772
}
845
773
@@ -860,11 +788,10 @@ body = ClientWriteRequest(
860
788
],
861
789
)
862
790
863
-
# Both operations will succeed regardless of tuple existence
864
791
response =await fga_client.write(body, options)
865
792
```
866
793
867
-
For a complete working example, see the [conflict-options example](https://github.com/openfga/python-sdk/tree/main/example/conflict-options).
0 commit comments