Does anyone know if there is a smooth way to extra...
# prisma-migrate
j
Does anyone know if there is a smooth way to extract/export resolvers from GC and convert them into local resolvers calling Prisma?
t
I used prisma-nexus and they have a cool SDL converter, and you can give it your endpoint, and they’ll give you all of the generated nexus resolver code. Made it go a lot faster: https://nexus.js.org/docs/database-access-with-prisma https://nexus.js.org/converter
j
Cool, thanks! I will check it out! 🙂
@tmoney how did you handle the e.g. allUsers() in GC to users() in Prisma/Nexus? Did you rewrite your client app or did you add an alias in server?
t
On the front and back end we just aliased everything, so every query with
allUsers
became
allUsers: users
and so on
And then moving forward we’re using just
users
j
great, thanks!
@tmoney sorry for taking your time again, but would you like to share how you created those aliases? I have found a way, but it feels like a lot of coding, I was hoping for a simpler solution (backend that is)
t
We literally just did a ton of code changes… haha. We didn’t alias it from the backend, we aliased every query on the frontend
j
ok, maybe that’s a better approach… my idea was to keep the client as is and only migrate the backend
t
If you can make that work that would be sweet. But I would also say, then you would probably end up keeping that convention in the frontend forever, which might also be its own confusing tech debt. So tradeoffs I suppose, but would definitely be much faster if you could completely alias it from the backend
j
True indeed, I will consider changing the client 🤔 Thank you for your input 🙏🏼