N+1 Queries No More

GraphQL makes a lot of the problems of REST much easier to solve. However, one of the things that actually becomes harder to solve is N+1 queries. Today we’re going to be talking about precisely how to resolve N+1 queries in rails and GraphQL. We will dive into the nitty-gritty details of how the concept of … [Read more…]

GraphQL Playground Review

These opinions are based on my experience with certain features of GraphQL Playground running v1.0.2-rc.1 and v1.1.1. Please keep that in mind as you read, since a new release could completely nullify anything I say here. Most people who have used GraphQL for any amount of time would agree that the king of GraphQL tooling … [Read more…]

Guide: Convince Your Boss/Team To Use GraphQL

Do you want to start using GraphQL at your day job, but just aren’t sure how to get the buy-in from your boss, co-workers, and/or team? I helped start a movement towards GraphQL at my job that eventually lead to GraphQL becoming the standard for all new projects. Along the way, I learned some things … [Read more…]

Stop Doing Hash Resolution By Hand

By default, the ruby gem for GraphQL will allow you to define your fields without a resolver so long as the object being resolved by the parent field for that type has a method with the name of the field in question. For example, if you had a Weather GraphQL type with a field defined like … [Read more…]

Build Better GraphQL APIs: Thinking In Graphs

When making the transition to a new technology, there are two really big blockers people tend to encounter that can cause them to give up: There are too many things that the learner has to understand before they can see and experience the benefits. The paradigm shift is difficult and can take time before the … [Read more…]

Shorten Your Argument List With Input Types

Before I discovered ruby, I used to be a java programmer. I have nothing against java (or java programmers), but there just tends to be something about java programmers and method calls that look something like this: buildSomethingFromThisAbstractFactoryAndSomeOtherStuffThatNobodyCanFollow(wow, there, are, really, sixteen, arguments, null, null, null, null, null, here, null null, null) Hint: if you … [Read more…]

FUD: Facebook and GraphQL

A while back, I wrote about a few different fears that I think hold some people back from using GraphQL. Apparently I missed one. It’s called… Wait for it… Facebook For those that don’t know, GraphQL was built by Facebook. Their front-end engineers got tired of dealing with the problems that REST presented them with, … [Read more…]

We Need More Best Practices In GraphQL

The other day, a coworker pulled up a chair next to me and said one of my favorite things to hear. “I’ve got some questions for you about GraphQL.” I was among the first to start to venture out into the world of GraphQL at RevUnit, and I’ve been been singing it’s praises ever since … [Read more…]

5 Things to Love about GraphQL

There are a lot of things to love about GraphQL, and a lot of reasons to use it. Here are 5 of my top favorite things about it. #1 Introspection GraphQL APIs understand themselves. I can query my API and see everything about my schema – what fields, objects, types, interfaces, and other entities that … [Read more…]

Clean Up Your Schema With Resolvers And Functions

Once you’ve been doing GraphQL for a while, you might start to notice that you have some repetition, or that your schema is getting unruly due to large resolvers. In this post, we will explore some ways that you can trim this down and share functionality between your fields using resolver classes and GraphQL::Function. When … [Read more…]