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
The READMEs' read relationship tuples example uses the same code block for different read API configuration (i.e., find if a relationship tuple stating that a certain user is a viewer of certain document, find all relationship tuples where a certain user has a relationship as any relation to a certain document, etc.)
Ideally, each type of API will have its own code block to improve reading experience.
For example,
# Find if a relationship tuple stating that a certain user is a viewer of certain documentbody=TupleKey(
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
relation="viewer",
object="document:roadmap",
)
response=awaitfga_client.read(body)
# response = ReadResponse({"tuples": [Tuple({"key": TupleKey({"user":"...","relation":"...","object":"..."}), "timestamp": datetime.fromisoformat("...") })]})
# Find all relationship tuples where a certain user has a relationship as any relation to a certain documentbody=TupleKey(
user="user:81684243-9356-4421-8fbf-a4f8d36aa31b",
object="document:roadmap",
)
response=awaitfga_client.read(body)
# response = ReadResponse({"tuples": [Tuple({"key": TupleKey({"user":"...","relation":"...","object":"..."}), "timestamp": datetime.fromisoformat("...") })]})
The READMEs' read relationship tuples example uses the same code block for different read API configuration (i.e., find if a relationship tuple stating that a certain user is a viewer of certain document, find all relationship tuples where a certain user has a relationship as any relation to a certain document, etc.)
Ideally, each type of API will have its own code block to improve reading experience.
For example,
The code in question is in
python-sdk/README.md
Line 388 in 1f4c734
Ideally, we will also fix the SDK generator so that newly generated python SDKs will have the corresponding changes. This is tracked as openfga/sdk-generator#126. However, if that is difficult to do, simply focusing on the Python SDK side https://github.com/openfga/python-sdk/blob/main/README.md will help us as well.
The text was updated successfully, but these errors were encountered: