Is there any way to avoid this? Seems like I shoul...
# orm-help
c
Is there any way to avoid this? Seems like I should be able to make the first part of that query only once.
Copy code
const flightController = await context.prisma.droneBuild({id: args.buildId}).flightController()
      const esc = await context.prisma.droneBuild({id: args.buildId}).esc()
      const vtx = await context.prisma.droneBuild({id: args.buildId}).vtx()
      const receiver = await context.prisma.droneBuild({id: args.buildId}).receiver()
      const camera = await context.prisma.droneBuild({id: args.buildId}).camera()
      const motor = await context.prisma.droneBuild({id: args.buildId}).motor()
      const propeller = await context.prisma.droneBuild({id: args.buildId}).propeller()
      const frame = await context.prisma.droneBuild({id: args.buildId}).frame()
      const antenna = await context.prisma.droneBuild({id: args.buildId}).antenna()
      const battery = await context.prisma.droneBuild({id: args.buildId}).battery()
r
I don't really know what this extract is, but just language-wise, can you not do e.g.:
Copy code
const drone = context.prisma.droneBuild({id: args.buildId});
const esc = await drone.esc();
const vtx = await dron.vts()
...
c
Yeah it’s a real bummer you CANNOT do that. b/c that’s exactly what I’d look to do to avoid re-querying the database 10 times for the same piece of starting info