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
When my UserType is loaded from another Type such as AlbumType, the Privacy attribute is completely ignored. Note that in the first request my CPF comes null, however, if I request this information from the AlbumType it returns and ignores my Privacy
Steps To Reproduce:
To reproduce, create the Types and the Privacy class and try to execute the commands in the prints below.
Code
class MePrivacy extends Privacy
{
publicfunctionvalidate(array$queryArgs, $queryContext = null): bool
{
if (!auth('sanctum')->check()) {
returnfalse;
}
if (!isset($queryArgs['id'])) {
returnfalse;
}
return$queryArgs['id'] == auth('sanctum')->id();
}
}
class UsuarioType extends GraphQLType
{
protected$attributes = [
'name' => 'Usuario',
'description' => 'A Usuario',
// Note: only necessary if you use `SelectFields`'model' => Usuario::class,
];
publicfunctionfields(): array
{
return [
'chave_pix' => [
'type' => Type::string(),
'description' => 'Chave PIX para recebimentos de pagamentos.',
'privacy' => MePrivacy::class,
],
'cpf' => [
'type' => Type::string(),
'description' => 'CPF do usuário.',
'privacy' => MePrivacy::class,
],
]
}
}
class AlbumType extends GraphQLType
{
protected$attributes = [
'name' => 'Album',
'description' => 'Collection of albuns with their respective category',
'model' => Album::class
];
publicfunctionfields(): array
{
return [
'id' => [
'type' => Type::nonNull(Type::int()),
'description' => 'The unique identifier of the album.'
],
...
'usuario' => [
'type' => GraphQL::type('Usuario'),
'description' => 'A list of fotos written by the user'
],
....
}
The text was updated successfully, but these errors were encountered:
Versions:
Description:
When my UserType is loaded from another Type such as AlbumType, the Privacy attribute is completely ignored. Note that in the first request my CPF comes null, however, if I request this information from the AlbumType it returns and ignores my Privacy
Steps To Reproduce:
To reproduce, create the Types and the Privacy class and try to execute the commands in the prints below.
Code
The text was updated successfully, but these errors were encountered: