excuse me, i have a question, Isn't this interface...
# spicedb
l
excuse me, i have a question, Isn't this interface (rpcReadRelationships) supposed to return a list? Why only one relationship, moreover , rpc WriteRelationships , How do I batch write? An error will appear:a relationship can only be specified in an update once per overall WriteRelation... (442 bytes)
v
👋🏻 -
ReadRelationships
is a gRPC Streaming API, you have to read from the stream to get the results, so you won't get a list - You can write transactionally multiple relationships.
WriteRelationships
allows you to do that, please have a look at the API specification in https://buf.build/authzed/api/docs/main:authzed.api.v1#authzed.api.v1.PermissionsService.WriteRelationships. That error suggests that, within the same
WriteRelationships
payload, you've specified the same relationship at least twice
l
thanks for your answer, but what i called is the http interface (/v1/relationships/read), but the result is a single data, can i get a list?
j
because it is a streaming API, if invoked via REST, you will receive responses in JSON-L format (https://jsonlines.org/), with each result being its own line
there won't be an overall JSON response, because it is being streamed over time