Query that plucks tags from Structure field

I tried calling a custom site method which returns an array, but that didn’t work. like query: site.getItems where getItems basically is like:

$array = $this->someField()->yaml();
return A::pluck($array, ‚tags‘);

(Strange apostrophes due to me typing on iOS)

Did it much like you described here