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: openfga/v1/openfga_service.proto
+34-3Lines changed: 34 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,10 @@ service OpenFGAService {
154
154
"type definitions allow OpenFGA to determine whether a "
155
155
"relationship exists between an object and an user.\n"
156
156
"In the body, `writes` adds new tuples and `deletes` removes existing tuples. When deleting a tuple, any `condition` specified with it is ignored.\n"
157
-
"The API is not idempotent: if, later on, you try to add the same tuple key (even if the `condition` is different), or if you try to delete a non-existing tuple, it will throw an error.\n"
157
+
"The API is not idempotent by default: if, later on, you try to add the same tuple key (even if the `condition` is different), or if you try to delete a non-existing tuple, it will throw an error.\n"
158
+
"To allow writes when an identical tuple already exists in the database, set `\"on_duplicate\": \"ignore\"` on the `writes` object.\n"
159
+
"To allow deletes when a tuple was already removed from the database, set `\"on_missing\": \"ignore\"` on the `deletes` object.\n"
160
+
"If a Write request contains both idempotent (ignore) and non-idempotent (error) operations, the most restrictive action (error) will take precedence. If a condition fails for a sub-request with an error flag, the entire transaction will be rolled back. This gives developers explicit control over the atomicity of the requests.\n"
158
161
"The API will not allow you to write tuples such as `document:2021-budget#viewer@document:2021-budget#viewer`, because they are implicit.\n"
159
162
"An `authorization_model_id` may be specified in the body. If it is, it will be used to assert that each written tuple (not deleted) "
160
163
"is valid for the model specified. If it is not specified, the latest authorization model ID will be used.\n"
"error", // Return an error if a tuple already exists.
1262
+
"ignore" // Treat identical writes as no-ops if all attributes (including the RelationshipCondition) match.
1263
+
]
1264
+
default: "error"
1265
+
example: "\"ignore\""
1266
+
description: "On 'error' ( or unspecified ), the API returns an error if an identical tuple already exists. On 'ignore', identical writes are treated as no-ops (matching on user, relation, object, and RelationshipCondition)."
"error", // Return an error if a tuple does not exist.
1284
+
"ignore" // Do not return an error if a tuple does not exist.
1285
+
]
1286
+
default: "error"
1287
+
example: "\"ignore\""
1288
+
description: "On 'error', the API returns an error when deleting a tuple that does not exist. On 'ignore', deletes of non-existent tuples are treated as no-ops."
0 commit comments