paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
684 stars 54 forks source link

Converting info object from prisma 1 connections to prisma 2 #128

Closed Karnich closed 4 years ago

Karnich commented 4 years ago

Hi there

Im trying to upgrade to prisma 2 and ive been using PrismaSelect so that i can take my info object and pass it to Prisma2.

I ran into the issue where Prisma2 no longer supports connections but i found this: https://github.com/devoxa/prisma-relay-cursor-connection

That seems like it would work, but my info object from the client still has the "connections" stuff in it.. like edges: { node: {..

can i somehow modify the info object on the server side either before or after using PrismaSelect? so that the selection will match findMany instead of Prisma 1 connections?

AhmedElywa commented 4 years ago

Hi @Karnich, can you provide an example of your findMany query to understand exactly what you need. You can modify return object from PrismaSelect

Karnich commented 4 years ago

Thanks @AhmedElywa. Actually when i wrote this question i realized that i had not looked at modifying the object from PrismaSelect. I had only look into modifying it before passing it into PrismaSelect. Doing it after was pretty easy! 👍