Moray Macdonald
09/15/2020, 1:01 PMRyan
09/15/2020, 1:11 PMMoray Macdonald
09/15/2020, 1:12 PMMoray Macdonald
09/15/2020, 1:12 PMtype Tenant {
id: ID! @id
}
type User {
id: ID! @id
owner: Tenant! @relation(link: INLINE)
}
Moray Macdonald
09/15/2020, 1:15 PMTenant
that the User
is linked to, I need to do this:Moray Macdonald
09/15/2020, 1:16 PMowner: (root, args, context) => await context.db.user({ id: root.id }).owner().id();
Moray Macdonald
09/15/2020, 1:16 PMMoray Macdonald
09/15/2020, 1:17 PMuser(id: $id){
owner {
id
}
}
Moray Macdonald
09/15/2020, 1:18 PMMoray Macdonald
09/15/2020, 1:19 PMCREATE TABLE User (id CHAR(25), owner CHAR(25));
Moray Macdonald
09/15/2020, 1:21 PMUser
without having to resolve it through a second DB query?Moray Macdonald
09/15/2020, 1:21 PMRyan
09/15/2020, 1:23 PMMoray Macdonald
09/15/2020, 1:24 PM