Fixed #14334 -- Query comparision now check for object types.

passed to query relations.