With a categories field, how do I query only the *selected* categories?
Here's how to isolate only your chosen categories. This works off the premise that if a related category is a parent of one of the other related categories, it is not a category you chose.
{% set relatedCategories = entry.myCategoryField.with(['parent']).all() %}
{% set parentCategories = relatedCategories | map(c =&gt; c.parent) %}
{% set chosenCategories = relatedCategories | diff(parentCategories) %}