any idea how to solve it in a more efficient way s...
# orm-help
v
any idea how to solve it in a more efficient way so im not doing unecessary database queries?
How i ended up solving it. By looking at wether or not the organization field is queried. If it is then I use “include” in prisma otherwise not.
And then in the resolver for organization in user i check wether organization is included or not in the user object. If it is I return that otherwise I make a new call with prisma to find organizations.
This solution “works” but it is not very nice or easy solution. Im sure there must be a smarter way to do this without overfetching.