hey yall, im creating a graphql apollo server(2.18...
# orm-help
s
hey yall, im creating a graphql apollo server(2.18.2) using prisma(client 2.9.0) as my database go-between. i have written my schema, which is heavily reliant on relational data and relational types are defined in the schema. as I began to write the resolvers, i was looking up the best approach to make use of Prisma's relational nature, but it seems I'll have to write individual resolvers for every individual type. this feels like it minimizes/defeats the purpose/benefits of the relational data provided by prisma by querying relations in the same call. is there something i am missing? is it best practice to resolve the relational data types via the relational data from prisma on the originating type, rather than making a call to the relational data directly? EX: (roughly coded, syntax may not be exactly accurate) query
user { profileInfo { fName, lName}}
resolver
prisma.users.findOne({include: {profileInfo: true}})
OR resolver
prisma.profileInfo.findOne({where: {userId: args.userId}})