Group Group Group Group Group Group Group Group Group

Vapor4 one to one relationship

I need to create a one to one relationship between 2 fluent entities but need some help as I don’t really understand how it works

I see there is new implmentation in vapor4 for @OptionalParent and @OptioonalChild. but I don’t really follow how this should be implemented with respect to both entities scheme and intiialisation and how it should be handled to access the relationship in the controller

In my models I have a User who has a single address.

Can anyone provide me an example of this following similar approach as how we handle other relationships in the book

thanks