Hi!
I’ve started playing around with the brand new @auth
/@custom
directives and I had a question about the former. What is the best way to “nest” the “and”/“or” logic? For example on the add
Dgrahp-genearted operation:
type Donor @auth(
add: { and: [
{ rule: "{ $isAuthenticated: { eq: \"true\" } }" },
{ or: [
{ rule: "{$role: { eq: \"USER_ADMIN\" } }"},
{ rule: "{$role: { eq: \"USER_INTERNAL\" } }"},
{ rule: "{$role: { eq: \"USER_LAB\" } }"},
]},
]}
) {
id: ID!
...
}
Would this work to make sure that the user is authenticated (isAuthenticated
) and one of the $role
values?
Additionally, what’s the best source binary to be using in order to have these new custom directives available? Which should I be downloading? Since the version in curl https://get.dgraph.io -sSf
does not have those directives.
Best,
John