You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project that specifies directives on types, similar to the Enforcing Access Permissions example. It looks something like this.
typeUser@auth(requires: USER) {
name: String
}
I've read the docs on implementing that @auth directive. The implementation shows the mapSchema call using both TYPE and OBJECT_FIELD. In the latter, we actually call the underlying resolve function if the user has the right role. If they do, we permit access to the particular object field.
In my case, I'd like all object fields to be resolved first. After resolution, I am able to determine if the user has the correct role to view the object. Is this possible with mapSchema?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am working on a project that specifies directives on
type
s, similar to the Enforcing Access Permissions example. It looks something like this.I've read the docs on implementing that
@auth
directive. The implementation shows themapSchema
call using bothTYPE
andOBJECT_FIELD
. In the latter, we actually call the underlying resolve function if the user has the right role. If they do, we permit access to the particular object field.In my case, I'd like all object fields to be resolved first. After resolution, I am able to determine if the user has the correct role to view the object. Is this possible with
mapSchema
?Beta Was this translation helpful? Give feedback.
All reactions