Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Fourth Example to Update Docs #680

Open
brettforbes opened this issue May 4, 2023 · 0 comments
Open

Add Fourth Example to Update Docs #680

brettforbes opened this issue May 4, 2023 · 0 comments
Assignees

Comments

@brettforbes
Copy link

brettforbes commented May 4, 2023

The most common type of update, is to update an attribute owned by an object, and yet not know upfront whether that attribute is owned by another object. There fore the question is whether to delete just the relation, or the relation and the object.

The two examples in the update docs, are toys, and assume perfect knowledge, where this is usually not true. It is not always true that you can update an attribute and be sure you can also delete it.

Can you add the fourth example, of the typeql needed to test whether the attribute is owned by another object, and if so just delete the relation, and if not delete both the attribute and the relation? (i.e. need a not clause)

Finally, lets say that the property is named revoked, which is both boolean and optional, and the aim is to set it to True (i.e. revoke the object). But you are not sure whether:

    • the property currently does not exist on the object
    • the property currently exists on the object and its value is False
    • the property currently exists on the object and its value is True (i.e previously revoked)

Can the update statement be used for all three of those situations, or only the first two? Can you provide a fifth example to handle those scenarios please? thanks

@izmalk izmalk self-assigned this May 4, 2023
@brettforbes brettforbes changed the title Add third Example to Update Docs Add Fourth Example to Update Docs May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants