A month or so I started a series on setting up GraphQL and Prisma with Apollo (Client & Server). Originally I was going to use a GraphQL Yoga server and just copy what I had done in a tutorial and explain what I learned, but someone suggested using the new Apollo Server 2. So, I went overachiever and decided to do that instead.
Turns out, I'm learning a ton more than I necessarily thought that I would, which is nice, but it also meant I had to stop that series for a while in the middle of it so I could make sure I actually knew what I was doing. Most of the problems being around passing authentication/headers/cookies back and fourth and not totally necessary for what I wanted to show, but I felt like I really didn't understand the tooling I was using since I was struggling with that.
So, first, how do you deal with setbacks? These are some of the things I did to get back on track.
1. Take a Break
This might seem counterintuitive, but taking a break is often what you need. It might be a break completely from the project, or just going and working on something else to get your mind in a new space. It's easy to get your mind stuck in a particular space. Sometimes we are focused on solving a problem a particular way and when you take a break you have a realization it might be something else, which leads you to look in a new direction.
2. Read Documentation
Sometimes, especially when you are new to a tool/framework/whatever, you just need to read the documentation in detail. For example, when trying to use a middleware to set up CORS between my servers I thought I had set it all up right, but kept getting the dreaded error that I didn't have the correct headers. After about an hour of trying all sorts of things, deep in the docs I find that my server has this all set up already, and it was overriding my more specific options from my middleware. That was causing the problem, and one line of
cores: false, solved the problem.
3. Take a Step Back
Don't assume everything you've done is working. I think often we get caught up in thinking, "Iv'e done this thing x way before, so i'll implement it x way this time and it'll work great!" The problem is, maybe it won't work great and something you assume is working is causing a problem that leads you to think something else is an issue. Sometimes I will just go back to the beginning (or back to the start of whatever is the problem) and just start logging things out or testing smaller pieces to make sure everything is as expected. It can help limit your focus to what the real problem is.
Now that (as of today) I seem to have life in Apollo land all sorted out and I can start working on continuing my series on it, it got me thinking, How do people usually start a blog series?
I think in a perfect world you would have everything written out ahead of time, but that seems to be large time commitment that I don't really have at the moment.
If you have ever wrote a series of posts, how do you go about writing it, and if you have setbacks in the middle, what do you do about it?