https://authzed.com logo
Title
u

Unhinged

01/12/2023, 11:20 AM
Hi, is it possible to get all relations of a particular kind. Say I want to delete a certain schema definition, then i need to clear all relevant relatios first, which makes sense! But can I ask SpiceDB to get all relevant relations without knowing all ressources involved beforehand. Its a kind of expected relation but only on type ?
v

vroldanbet

01/12/2023, 12:07 PM
👋🏻hi, if what you are looking for is for help deleting all relationships of a relation that is to be deleted in a
WriteSchema
operation,
DeleteRelationships
has some fields that help you with that. So you can tell it "delete all relationships of this relation", for example. https://buf.build/authzed/api/docs/main:authzed.api.v1#authzed.api.v1.PermissionsService.DeleteRelationships note the
relationship_filter
field in
DeleteRelationships
https://buf.build/authzed/api/docs/main:authzed.api.v1#authzed.api.v1.RelationshipFilter
u

Unhinged

01/12/2023, 12:08 PM
Hi thx, just figured it out, sometimes it helps just to formulate the problem to others 😉
v

vroldanbet

01/12/2023, 12:10 PM
you are most welcome to drop by and formulate your thoughts 😄