Articles

  1. Generating Types with Apollo CLI

    If you're ever trying to talk someone into liking GraphQL, a good place to start is by explaining that GraphQL is a type system for your API. Enforcing types is something that GraphQL is really good at, and if you add TypeScript in the mix, you're dealing with a pretty powerful combination. GraphQL and TypeScript are like Leslie Knope and Ben Wyatt - they both love rules, and they both bring out the best in one another.

    Read more
  2. Setting Up VSCode for Teaching and Recording Screencasts

    In a couple weeks, we're going to be celebrating Moon Highway's eighth anniversary. Eight years of classes, video recordings, talks, and webinars. There's been a whole lot of typing into a code editor in front of people, and one of our main goals when doing this is to make sure that people can read the screen.

    Read more
  3. Working with Query Arguments

    A common refrain you'll hear about GraphQL is that you can make one request and get only the data you want. A query will return just the fields that you request, nothing more and nothing less. For example in the allLifts query, we make a selection for a certain set of fields:

    Read more
  4. Designing GraphQL Schemas

    When you start working with GraphQL, you'll start to realize that GraphQL is going to change your design process. Instead of looking at your APIs as a collection of REST endpoints, you'll start looking at APIs as collections of types. Before breaking ground on your new API, you need to think about, talk about, and formally define the data types that your API will expose. This collection of types is called a schema.

    Read more
  5. Understanding the GraphQL Query Language

    When Facebook open-sourced GraphQL, it had a few different parts. It came with a spec. That specification document described all of the features of the GraphQL query language and the schema definition language. It also came with a reference implementation of a GraphQL server called graphql.js. This was an example of what a GraphQL server might look like so that other people could implement their own servers in a variety of languages.

    Read more
  6. GraphQL Mocking Techniques with Apollo Server

    One of the most powerful features of GraphQL is its schema definition language. When we write a schema, we define all of the types that are available on our API. If our GraphQL server provides us with an enforced list of type definitions, that means that GraphQL gives us an added benefit: mocking.

    Read more