Query.include() not including all fields in referenced item when afterQuery hook exists on referenced collection

In my code I query a collection with a .include(“referencedItemProperty”), and the referenced item is part of a collection that has an afterQuery hook. The referenced item objects in the resulting items from my query only show the referenced item’s system generated fields, not the fields I added to the collection. When I delete the afterQuery hook however, the referenced item objects in the resulting items from my query contain all fields, both system and the ones I added. Any ideas on how to get all fields in the referenced item objects with the afterQuery hook. Thanks in advance.

SOLVED: The referenced collection contained a reference to another collection… query.include() includes referenced items as objects in the items it returns, but it leaves referenced items within the referenced item objects in the items it returns as strings of item IDs. In my afterQuery hook I was trying to assign values from the referenced items within the referenced items in the items my query.include() was returning to the referenced item objects in my query item results. However these values I was assigning were evaluating to null and thus removing the fields I added to the referenced collection from my query results.

To clarify, there were 3 levels of collections: Collection A referencing Collection B referencing Collection C. Hope this helps someone down the road