Encode type constructor in Query

Review by @cvogt