But ```api.getRelationships({ namespace: 'Grou...
# talk-keto
p
But
Copy code
api.getRelationships({
    namespace: 'Group',
    relation: 'members',
    subjectId: user.id,
});
returns no results.
s
Yes, you need to also use the subject set in the get/check requests
p
why / can you provide more context
can I query which groups is the user a member of?
how do subject sets come in to this — all the cat lady and chat examples have no subject sets
not prominently anyway
s
so originally we had subject sets and unscoped subject IDs, but turned out you probably want to scope subjects so using a subject set with no relation is basically a scoped subject
the examples are outdated there...
sorry for that
p
okay so subject id is out
s
TL;DR only use subject sets everywhere, we want to deprecate and remove subject IDs anyway
p
Copy code
await api.getRelationships({
    namespace: 'Group',
    relation: 'members',
    subjectSetNamespace: 'User',
    subjectSetObject: user.id,
});
oh wait no,
subjectSetObject
Uhm…
"incomplete subject, provide \"subject_id\" or a complete \"subject_set.*\""
so I need to add an empty string relation?
yea, that’s it
need to mangle OpenAPI types so that it has a strict OR between
string | SubjectSet
isomorphic type
otherwise the requirement isn’t present at compile/static check
or make
subjectId
@deprecated
is there a way to limit depth? Like if I don’t care how the user is a member of a group, I just need a list of groups
s
we had it polymorph but it did not work well for all languages...
the list is always only one level
p
oh so it’s just the subject set key
okay, great
s
if you can I'd always recommend grpc over openapi because the clients are so much better
p
not opposed
node grpc avalable?
s
yes!
p
weeee
so they’re separate clients vs axios one big blob
@ory/client
s
well only keto supports grpc rn
p
oh
sad
s
was kind of an experiment with success, but it is not an easy thing to rewrite all services 😅
especially when you have HTML form APIs, OAuth2, ...
p
actually the html form API is another question;
s
yeah but it would be great to not maintain several different servers in one codebase
we looked into grpc gateway, which could make it work, at least for all json apis
but again, a bit of work required
p
posted in #kratos