Prisma Migration

February 17th, 2020
prisma

It's a Cinch

After working with Prisma for a couple of days now, I remain completely blown away by it's power and simplicity. We spent the better part of half of Andrew Mead's The Modern GraphQL Bootcamp setting up what Prisma does straight out of the box with very little configuration. I've used some tools that are incredibly difficult to navigate around, and you end spending most of your time just trying to figure out how to use them; this is not one of them. Prisma has great documentation and just takes a little setup to get everything the way you want it to be. There is a bit of a learning curve, as far as learning the directives that go along with the nodes and figuring out what all it can do, but since GraphQL is self-documenting, the playground provides a lot of the information you need to be able to figure it out. Not to mention, Andrew is doing a great job teaching this course and I really like how he has laid it all out. He allowed us to go through the pain and struggle of setting everything up without the use of Prisma before he introduced it, which is really important, in my opinion. We now have multiple options of how to set mutations, queries and subscriptions up, and it all makes perfect sense. As I've said, without the constant challenges, I don't think I would be learning nearly as much as I am, but those really take the whole thing to another level. Not to mention, the way he explains things is very clear and concise; I have yet to feel lost in a single part of this course.

prisma

I spent a lot of my study time today taking old code we had written with just NodeJS and migrating it over to work with Prisma. Actually, the first half of my study time, we set up a dummy project for book reviews. This was a quick challenge where we built out all of the nodes for users, books, and reviews for these book reviews and then set up the directives for these. This was the last part of the module on database storage with Prisma, and it was mainly meant to illustrate how to use the relation directive on Nodes in Prisma. This is something that is unique to Prisma, but is a relatively simple way of doing something pretty complex. We had done the same thing earlier in the class with the main project, but without Prisma, and it was a lot of code, and pretty complex code at that. We ended up using a lot of functional JavaScript and manipulating arrays to delete posts and comments when users were deleted, or deleting comments when posts were deleted. With the relation directive, all of this is handled in just a few words and it's very straightforward. We then moved on to changing all of the queries and mutations to use Prisma directly instead of the dummy database we had initially set up. Because of the relation directive, we are able to delete a ton of code and not have to worry about a bunch of steps. All we have to do is turn the methods, like createUser or deleteUser, into asynchronous functions and then call the method associated with that query or mutation, passing in the arguments associated with that method. Again, it's so much more concise and gives you so much straight out of the box, with just a little bit of configuration. Big fan of Prisma.

prosCons

On Friday, I reached out to an employer I had received a job offer from back in December. If you don't know the whole backstory, I turned the job down because I thought the offer was well below what I deserved or even what the industry standards are. I've had a lot of time to think about it, and I often regret it. My biggest hurdle with making this career change is not having any kind of professional experience in the field, and this would solve this issue. It may not be the most perfect option, but it may be a means to an end. In the email I sent, I expressed that I noticed they still had the job opening posted online, and the only reason I turned it down was because of the offer provided. If they were able to improve the offer, I would happily reconsider. I heard back from them today with a mixed result. They still think the offer was in line with my experience and didn't sound like they were willing to budge any on that, but they were more than happy to meet again and asked if I would like to come up tomorrow. I haven't had a chance to talk to my fiancé yet, but I'm still conflicted by this decision. I think there are some huge positives to it, but there are some warning signs that I think I need to look out for. At the end of the day, I wouldn't be making a career out of this one job, and it would likely lead to a lot of other jobs opening up for me in the future, so it might be time to just bite the bullet and take what I can get. Since I haven't been able to find anything else lately, this might be it.

Until tomorrow!

Created by Sam Thoyre, © 2019