Stop spinning up the whole world

Question: How can I work on just my microservice without also running a Gateway and all of the other related services?

Answer: Just like it works in Production


OK, so that’s a cheeky answer. In production, you have a Gateway, and you have all of the other services. What I mean by this is: your service doesn’t know any of that. It doesn’t know it’s part of a Gateway. It just knows how to respond to queries, just like every other GraphQL server. Let’s take this a step at a time, and I can show you what I mean:

Getting Started


What does it do, and how does it help?

The goal of @provides is to make it so that if you’re using Apollo Federation, you can reduce the number of backing calls that your Gateway makes, if the data could be returned from multiple services.

For example, if you always store the “actor” (the paper trail of who is performing actions) as “employee name (badgeId)”, you could always return an Employee object with both of those fields, without calling to the backing Users service. …

Timezones, dates, timestamps: differences and management in JavaScript, Typescript, GraphQL, Postgres

Like [probably] most engineers, I hate time zones. They are the bane of my existence, and I feel like I have lost years of my life (maybe months, depending on your time zone) to dealing with them as a problem. If you’re here, you know why it’s a problem, so I don’t have to tell you. Let’s jump right in and break down how to properly deal with “dates” so that we don’t have to complain about this anymore.

Dates generally break down into 2 basic types. The programming terms around these types vary between languages, and they may be…

So I’ve got this problem

So I’m building an open source feature flag system. I want the ability to easily roll out a feature to a certain percentage of users. To do this, I need to assign everyone a number between 0 and 99, inclusive (or 1–100, I don’t care). The idea being that if I take a sampling of everyone everyone with buckets 0-9, that would be roughly 10% of all of my total users.

The first idea was to just increment. For each user, if they needed a bucket, I’d just increment my counter and persist that to the user (cookies, database, etc)…

Scare tactics don’t work anymore. The rules are changing. It’s time to keep up.

Let’s set a scene. You’re in a meeting at work. You’ve been under deadlines recently, and you’re all a little stressed and have been working hard to meet those deadlines. The boss comes in and talks about how we have to step up and put in extra hours. Then he says the classic executive words “You can be replaced”. You stop talking.

What just happened?


In the business world, “fear tactics” like this have been employed for a long time. It’s really the way all business…

When Visual Studio Code was announced, I didn’t care much one way or the other. I’ve been an avid SublimeTexter for years, and before that a TextMater. I feel like I’ve been open to trying new things, but I’ve never quite found the “next thing”. I decided, however, that I would give VSCode a real go. I promised to give it a month, and see how I felt at the end of it.

Set the Stage

I am a Node.js Architect. What I’m looking for is a mostly-text-editor, ideally with some powerful IDE-esque tools at its disposal. I appreciate a solid IntelliSense, Linting…

Dan Crews

Node.js Architect and Web Developer. Lover of all good technologies (and some crappy ones), and sometimes I write about them.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store