sexnine
Explore posts from serversDTDrizzle Team
•Created by sexnine on 7/6/2023 in #help
[Relational Queries] Nullable one-to-one relationship
Hey y'all.
I'm using the relational queries feature and have a one-to-one relationship between these two tables.
I have this query to fetch a user, their team (if they have one) and their team's project (if they have one).
This is the return type of that function.
The problem is, project could potentially be
null
if the team does not have a project.
I'm not really sure what to do here to tell TS that project can be null
. Am I creating the relations correctly or am I doing something wrong? How should I solve this?
Thank you in advance for the help and I apologize for the long question.8 replies