Correct typehinting in QueryCompiler.

We should typehint the public methods instead of the protected ones as per coding guidelines.
Also fixed the docblocks around it.