Little Better

February 13th, 2020
better

Still Not Great

I'm on day 4 or 5 of having this cold, and the third day in a row of it kicking my butt completely, but today was definitely better than the last 2 days. Yesterday was the worst, but at least I was able to go home from work fairly early and catch up on a little rest; that helped a lot. While I took a nap yesterday, the cold seemed to move from my head into my throat and chest. This doesn't sound like an improvement, but I was able to think a lot more clearly today and my energy level was much higher, at least for the first half of the day. I was stuck at work for 10 and a half hours, and by about 3 today, I was once again starting to feel like I did yesterday. Now that I'm at home and working in bed, I feel a little better. I've been coughing up a lung most of the day, but overall I feel like the cold is on its last leg. Again, I hate to even make a big deal out of it. There are people who are dealing with much bigger health issues than just a common cold, and while it seems rough for me, it's nothing in the grand scheme of things. In the end, I'll eventually get better and barely remember being sick in the first place. My general manager at my club is dying of cancer right now and one of my members just lost his eye due to a freak accident at the course, so yeah, this cold is pretty dumb to even talk about.

brainercise

Moving on, I was able to get a little more work done tonight than I have been for the last couple of nights, and it didn't seem like I was watching a lecture spoken in a foreign language. I'm working on Andrew Mead's The Modern GraphQL Bootcamp on Udemy and am almost through with the basics of GraphQL. I just finished up a section on mutations in GraphQL, which included 3 parts of the CRUD operations, create, update, and delete. Today, we talked about 2 main things: setting up a proper project structure and updating data as a mutation. Up until this point in the code we've been writing, we kept everything in one file. All of a sudden, this file was over 300 lines long, and it was time to talk about how to break this up. We created a file for the GraphQL schema itself, which holds all of the code that is actually written in the GraphQL query language. Then, we created a database file, which just held the seed data. We created a separate folder for the resolvers, holding 5 files in all, one for queries, mutations, the post, the user, and the comment resolvers. With this setup, the index.js file went from over 300 lines down to just over 20, and only held the setup and configuration code. Everything else was neatly placed where it should be, making everything much easier to read

presenting

After breaking everything up and making the code much more manageable, we moved on to discussing how to update data using a mutation. As usual, Andrew showed us how to do this with a user, creating a mutation in the schema that takes the arguments of an id and of data which was set to an input type that held the appropriate properties for a user, which was the name, email, and age. We then set up a resolver that checked first for whether the id for that user was an actual id, and then went through whatever it was the user was trying to update. All of these were set to be nullable, so if the user only wanted to change their name, but not their email or age, those 2 values could just be omitted. After walking us through it, he set us loose on trying to do the same thing with posts and comments. I've found this way of teaching to be superior to every other way of teaching I've found on Udemy, and only comparable to Will Sentance's. Of course, these 2 instructors are entirely different and teach entirely differently, but the quality of instruction and style of learning are similar in a lot of ways. I've discussed this a couple of times now, but it's so important to hit "blocks" when problem solving. If you are just following along with code, you aren't actually hitting those issues and are missing out on important opportunities to learn something and dig a little deeper. I understand the importance of the follow-along type of tutorials, but I think I'm learning so much more from this course than I have in any other courses on Udemy. I will be taking everything else Andrew Mead has to offer.

Until tomorrow!

Created by Sam Thoyre, © 2019