graphql-mongo-helpers icon indicating copy to clipboard operation
graphql-mongo-helpers copied to clipboard

Is there a way to specify `viewerCanSee` just for some `load`s?

Open noghartt opened this issue 2 years ago • 0 comments

Can I specify the viewerCanSee function just for some load? Something like:

UserLoader.load(context, userId, ctx => ctx.user.id)
// On the third argument (optional), either return the `data`  if the value from callback isn't a falsy or `NullConnection`

I think that it would be interesting to deal with "atomic" logic behind some loads. Is there a way to do it? If not, would be interesting to implement something like it?

Probably, based on #240, the first argument context wouldn't be necessary as well.

noghartt avatar Dec 18 '21 02:12 noghartt