type check of relations
added test
Merge pull request #2734 from anlutro-pull-requests/relationship-type-check

Type check of relations