Make documentation queries also return a type

Issue #409