Privacy
Override Method
By overriding a method with set[FieldName]Privacy
format in your Pepper class, you can define custom privacy for each field:
You can set custom privacy attributes for every Type's Field. If a field is not allowed,
null
will be returned rebing/graphql-laravel#privacy
public function setEmailPrivacy($args)
{
return false;
}
Another example:
use Illuminate\Support\Facades\Auth;
public function setBalancePrivacy($args)
{
// Include balance property if the user is authenticated.
return Auth::check();
}