Duplicate queries using bulk action

I'm getting a whole bunch of duplicate queries trying to use a bulkAction in my admin panel. I followed pretty much the docs as described here https://filamentphp.com/docs/2.x/tables/actions#custom-forms:
->bulkActions([
                Tables\Actions\DeleteBulkAction::make(),
                BulkAction::make('changeDepartment')
                    ->action(function (Collection $records, array $data): void {
                        $records->each(function (AccountEntry $entry) use ($data) {
                            $entry->department = $data['department'];
                            $entry->save();
                        });
                    })
                    ->form(
                        [
                            Select::make('department')
                                ->label('Department')
                                ->options(Department::pluck('name'))
                                ->required(),
                        ],
                    ),
            ])

Attached is a screenshot of my debugbar when I open this resource on my admin panel. If I use a closure for form() I can defer the loading of departments until the bulk action is triggered, but it still does a bunch of duplicate queries. Is this normal?
image.png
Was this page helpful?