Add assertion for undefined type in a relationship