Throw an error if the output type does not match the expected type.
A query operation output.
The expected output type.
Throw an error if the output type does not match the expected type.