How to get accessor field in getSelect() or in resolve function when selectable is set to false in GraphType

15 Views Asked by At

IN GraphType

public function fields(): array
{
'is_tenant_owner_company' => [
'type'          => Type::boolean(),
'description'   => 'Whether the company is the owner company of the tenant',
'selectable'    => false,
]
}

Note : is_tenant_owner_company is accessor on the model

I need to check if this attribute is requested in the query which return this GraphType

I can do $selects = $fields->getSelect(); but for that I will have to set selectable = true in above code (which I am not sure if its a right way)

Is there any other way to get this accessor in resolve function??

0

There are 0 best solutions below