Sign in

I’m a Front End Engineer who loves React, NextJS, and GraphQL. Need a REMOTE React Developer? Contact me at: https://www.linkedin.com/in/bengrunfeld/

Please follow me on Twitter, or come say hi on LinkedIn, and if you enjoy the article, please give it a clap — they lower my cholesterol 😃

Scalable GraphQL Architecture
Scalable GraphQL Architecture
Scalable GraphQL Architecture

GraphQL has been the new “In Thing” for a couple of years, but bigger companies are just starting to adopt it, and one of the first questions they ask is: how does it scale?

In my humble opinion, the answer is: it scales WAY better than REST.

The second question is often: ok, how do we scale it?

Here is my approach, which is somewhat simplistic, but extremely functional.

The only tools…


The thing I like the most about React Testing Library (RTL) is its simplicity.

Of course, you can do complex things with it, but at it’s core, it’s quite minimalist and straightforward — it doesn’t try to be everything to everyone. Not too much hidden background magic, and a straightforward approach, just the way I like my software. Let’s dive in.

React Testing Library — Tutorial
React Testing Library — Tutorial
React Testing Library — Tutorial

To those new to the library, RTL helps you test your Front End components. Its testing lifecycle is quite simple:

  1. Render the component
  2. Test if the rendered HTML is as expected
  3. If your component has asynchronous functionality, wait until…


The N+1 problem occurs when we use data returned from the database to fuel a list of further queries to the database.

Article title image. Solving the N+1 Problem in GraphQL
Article title image. Solving the N+1 Problem in GraphQL

Meaning, if you receive a list of results from a query, then for each result, you will make another query to the database.

In this case, the N stands for the number of results returned from the database, and 1 stands for the initial query that was made.

To clarify: the problem is that for each of the N results returned, we will have to make another query, so there will be N requests made to the database…


Warning: Prop `className` did not match. Server: “fs-fdsf” Client: “sd-dfasj”

The combination of Next.JS and Styled Components is truly epic. You get fast, Static Rendered, highly semantic code as a result of the union, but you also get an error unless you know the secret config that solves it (like so many things in our industry…. 😒).

This is likely the error you’re getting, or some variant of it:

Warning: Prop `className` did not match. Server: "sc-gKsewC" Client: "sc-dlfnbm"

For some reason, it’s actually kinda hard to find the solution. It’s listed on an obscure Github issue somewhere. Well, without further ado, here you go.

First run:

npm i babel-plugin-styled-components


Code is read much more often than it is written

– Guido Van Rossum, Creator of Python.

Source: https://www.python.org/dev/peps/pep-0008/

It is of utmost importance that we make our code as readable and semantic as possible, so that the next person who comes and reads it is able to quickly understand what the intention was, what the logic is, and how to alter it to meet the new business requirements.

Inline Styles

It is generally accepted that inline styles are not the best idea, because they make the code so much less readable.

Imagine if we were on a page that contained…


Looking for a great Software Engineer? Or just feel like having a chat? Visit my profile on LinkedIn and say hi! 😃

Common web hack attacks
Common web hack attacks
Common Web Attacks

Security has to be a core part of our work, not an auxiliary skill. As such, it helps to know the most common types of attacks that hackers carry out.

Common Pathways of Attack

The following access points into your application allow a User to provide custom input. A hacker can take advantage of these access points to send malicious code instead of valid data, which can cause unwanted and dangerous effects, and compromise security.

  • HTML forms
  • URL’s
  • API Requests that allow…


Looking for a great Software Engineer? Or just feel like having a chat? Visit my profile on LinkedIn and say hi! 😃

If you enjoy this article, please hit the clap button 👏🏻 so that someone at FAANG who read it thinks I’m cool and offers me a sweet dev job! 😉

Web Security Fundamentals
Web Security Fundamentals
Web Security Fundamentals

Much of this content came from LinkedIn Learning’s fantastic course.

General Security Recommendations

  • Validate & Sanitize inputs and outputs
  • Provide a Content Security Policy (CSP)
  • Use cookie settings like HttpOnly, Secure, and Expire
  • Always use HTTPS
  • Mark session cookies as Secure Cookies
  • Force the User to perform an additional step for…


Looking for a great Software Engineer? Or just feel like having a chat? Visit my profile on LinkedIn and say hi! 😃

If you enjoy this article, please hit the clap button 👏🏻 so that someone at FAANG who read it thinks I’m cool and offers me a sweet dev job! 😉

Using Formik together with Yup, TypeScript, and react-select can seem a little daunting at first. I mean, getting different libraries that share concerns to play nice together is often a recipe for hours of Googling how someone else did it, then finding that the implementation doesn’t work on…


Looking for a great (remote only) React Dev? Or just feel like having a chat? Visit my profile on LinkedIn and say hi! 😃

Often, the hardest part of using a package is configuring it and making sure it plays nice with all the other packages that work in the same domain.

Naturally, there’s significant overlap between ESLint, Prettier, and TypeScript, and if you haven’t set it up in the right way, you’ll soon be gazing in a bovine trance at the “Great Wall of Errors”.

In this article, we’ll go over installation and configuration, but we’re not going to…


Looking for a great (remote only) React Dev? Or just feel like having a chat? Visit my profile on LinkedIn and say hi! 😃

Docker: Hot Reloading with Next.JS
Docker: Hot Reloading with Next.JS

This one really took me a while. I got all the concepts, but there were several coffee (pfft… and cookie) breaks until I figured out exactly what the directory mappings needed to be.

tl;dr

Implementing Hot Reloading with Docker and Next.JS is literally two (2) lines of code! npm run dev, and a mapping between your local project directory and a directory on your Docker instance, using a volume:

./:/src

That’s it! (although I use usr/src/app instead…

Ben Grunfeld

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