Hey a friend of me made a module to make a "bridge...
# madewithprisma
a
Hey a friend of me made a module to make a "bridge" in a GraphQL server using Prisma to connect the GraphQLInfoResolver (AST of the query) to the include parameter of Prisma easily. You can check it out here : https://www.npmjs.com/package/graphql-prisma-info-include
prisma rainbow 4
fast parrot 4
n
Very cool! This also looks similar to this tool from Pal.js built by @Ahmed 😄
👍 2
a
Thank you. Yeah it's similar didn't know it exist.
👍 1
a
Also, my one handling many cases and simple more than this
j
@Daan Helsloot 😮
a
Apparently it doesn't support union type or it's not in your examples. Because we need it in our case but yeah for a general case your tool seems more appropriate.
a
@AurelienFT you can use valueOf method to get the union type. like if you have two models
parent
and
student
. you will need to back one of them so your use case will be like.
Copy code
const parent = new PrismaSelect(info).valueOf('parent', 'Parent');
const student = new PrismaSelect(info).valueOf('student', 'Student');
Also, I don't have examples for all uses cases. but I have docs for my methods so you can use them to fix any case.
a
Ok ty for precisions