How to effectively model “errors” in your GraphQL schema

We all know how great GraphQL is when things go well, but what happens when things don’t go well?

How do we handle errors in GraphQL? How can we do it in a way that’s easy to understand?

Let’s start by running a simple GraphQL query:

we might get something like this:

This is what we hope to see. But it’s not always smooth sailing. What happens when we make this same query but something goes wrong?

starting with knowing absolutely nothing about building keyboards

This keyboard building guide and saga started off with me simply wanting an adorable keyboard…

…and subsequently deciding that building my own ergonomic keyboard was my best course of action.

When I started this project, I knew absolutely nothing about keyboards or how to build them. I found it a bit difficult to find good material on building a keyboard, so I figured I’d write down everything I learned in a way that’s easy to understand.

The body

First, you’ll need to decide what kind of body you want your keyboard to have. …

A while ago, we told the story of how we are migrating to React.js and a service oriented architecture with the help of GraphQL. Now, we want to tell the story of how the structure of our GraphQL server helped make our migration much smoother.

We had three things in mind when we began designing our GraphQL server:

It should be easy to alter the shape of the data
We currently use protocol buffers as a schema for data that comes from our backend. However, the way we use our data has changed over time, but our protobufs haven’t caught up…

Last week, Medium hosted our first ever GraphQL Tech Talks! Thank you to everyone who attended! It was great being about to share what we’ve learned and chat with the GraphQL community. 🎉

For those who weren’t able to attend, we have good news. We were able to get videos of all of the talks! 😱 📹 🗣

Here they are. Enjoy!

Jonathan Fuchs with Figuring out when and where to query using GraphQL
Dan Gilk with Medium’s Android app power by RxApollo
Sasha Solomon with 200 OK! Error handling in GraphQL

Medium has been working with GraphQL for over a year now! We’ve built out our GraphQL server on top of our existing backend in such a way that, with the help of Protocol Buffers, we have been able to make progress migrating to React.js and a service oriented architecture without hindering product development!


🧀 🍇 6:00pm — 6:30pm ~ snacks + chatting

👩‍💻 👨‍💻 6:30pm — 8:00pm ~ tech talks

🤔 👋 8:00pm — 8:30pm ~ closing, questions, + chatting

Here’s a bit more about the talks and our speakers! 🗣

Five years ago, Medium was built using the latest tools and frameworks by people who had experience with those tools. It’s time that we update these tools and frameworks.

However, migrating an entire system to new tools and frameworks isn’t an easy task. And doing that while not impacting feature development? That’s even harder.

So, how would you migrate off of your existing system, without hindering feature development, but also incrementally gain the benefits of the new system along the way?

We began by testing out different frameworks and technologies and figuring out which ones deliver on the dimensions we…

Do you know what your teens/friends/colleagues are doing?

Everything was going great until about a month ago. I hung out with friends, engaged with people on social media, participated in outings with colleagues.

And then it happened.

A video of a fidget spinner. Huh, that’s weird. What’s a fidget spinner?

Oh, it’s just a spinny thing with some ball bearings? It spins around. Kinda lame.

I thought nothing of it.

But I start seeing them more and more.

I’m innocently scrolling through my facebook feed. What do I see? A FUCKING TUTORIAL FOR MAKING A FIDGET SPINNER OUT OF BULLETS

In Spark code, you may have seen DataFrame and RDD used similarly and wondered “What’s the actual difference between the two?”

While used similarly, there are some important differences between DataFrames and RDDs. DataFrames require a schema and you can think of them as “tables” of data. RDDs are less structured and closer to Scala collections or lists.

However, the biggest difference between DataFrames and RDDs is that operations on DataFrames are optimizable by Spark whereas operations on RDDs are imperative and run through the transformations and actions in order.

An RDD (Resilient Distributed Dataset) is a sequence of operations…

I’ve been playing Dungeons and Dragons for about 8 years, the majority as a player. I’m currently involved in two different campaigns: one has been going on for 4 years and the other for a year and a half.

From my time as a player, I know what works well in a campaign and what doesn’t, and what keeps the players involved.

Act like you know what you’re doing (especially when you don’t)

One of the most important things in a campaign is immersion. If your players don’t feel like they’re a part of the world, they will be distracted and pulled out of your universe.

If the party decides to…

I was working with some reaaallllyyy long regexes in Scala.

Something like:

The actual regex doesn’t really matter. The point is, it’s really long. So, I wanted to write it on multiple lines instead of one, really long line.

In Scala you can do this with """ """.stripMargin. So something like:

This turns your long String into a multiline String and then removes all instances of the multiline character (by default is |)…

Sasha Solomon

software engineer @twitter, previously @medium. doing scala + graphql. pokemon gym leader. potato compatible. @sachee

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