A weekly newsletter of the best news, articles and projects about GraphQL

Articles

What's new in GraphQL CLI 4.1

In this article, Enda Phelan covers new features in GraphQL CLI 4.1. He talks about the "serve" command, "init" command templates and other updates. Read on to find out how you can speed up your GraphQL development with the GraphQL CLI.

Articles

Offline-first made easy with GraphQL, Amplify DataStore and Vue

In this article, Gerard Sans shows how to create a Progressive Web App (PWA) that stores data on the device while offline and syncs it with a database when online. This is done with Amplify DataStore, GraphQL, and Amazon DynamoDB. Follow along with Gerard to learn how to build an offline-first Vue app powered by GraphQL.

The Dream Query: How we scope projects with GraphQL

In this article, Mark Larah talks about how Yelp uses GraphQL to scope new features. Mark goes into detail about the "Dream Query", a pattern that Yelp uses to help teams create features and refactor pages. He also talks about how Yelp uses graphql-faker to move quickly with new UI development.

How GraphQL Flexibility Gives Highly-Scalable Businesses a Competitive Edge

In this article, Martin Buhr talks about how GraphQL is advantageous for scalability. In particular, he details how GraphQL can be used with multiple microservices. Martin talks about how large companies like Airbnb and Expedia are using GraphQL to their advantage and also how GraphQL can be managed with API management.

Articles

Securing Your GraphQL Server

In this article, Eve Porcello talks about security considerations that developers should take into account when building a GraphQL API. She demonstrates how to implement request timeouts, how to put limitations on the amount of data returned, how to limit query depth and complexity, and more. Follow along with Eve to find out how to harden your GraphQL APIs.

How To Manage File Uploads In React With Google Storage And GraphQL

In this article, Nwani Victory demonstrates how to handle file uploads with GraphQL from a React front end. He talks about how to set up a GraphQL API in Node, how to implement the resolvers that are needed for file uploads, how to set up a Google Cloud Storage account, and how to initiate the upload from the React app. Follow along with Nwani to learn all the steps necessary for handling file uploads in your GraphQL app.

Articles

A Better Way to use GraphQL Fragments in React

In this article, Alec Brunelle talks about how to use GraphQL fragments in isolated React components. Isolated components, such as those built in React, should be responsible for defining the data they need to render. GraphQL fragments can be used to help achieve this goal. Follow along with Alec as he demonstrates how to use GraphQL fragments in React.

Articles

GitHub Mobile and GraphQL

In this article, Hesham Salman describes how GitHub has put GraphQL to use for its mobile applications. He goes into detail about how GitHub adopted a GraphQL mindset, what it was like to move from REST to GraphQL, how they have used code generation, and more. He also talks about how GitHub has used Apollo's tooling to be successful with GraphQL.

Server Driven UI, Part 1: The Concept

In this article, Joe Birch goes into detail about how to adopt a server-driven UI approach to building applications using GraphQL. He talks about what server-driven UI is, where it can be beneficial, and how you can create a GraphQL API to furnish this approach. Follow along with Joe to find out more about how you can use GraphQL APIs to your advantage when building user interfaces.

Introducing Obsidian: GraphQL, built for Deno

In this article, Travis Frank introduces Obsidian, Deno’s first native GraphQL caching client and server module. Obsidian is equipped with lightning-fast normalized caching to support scalable, highly performant SSR React applications built with Deno. Read on to find out more about Obsidian and how you can start using it today.

Articles

Ready to Scale: Refactoring GraphQL Schemas

In this article, Eve Porcello demonstrates how to refactor a GraphQL schema to make it easier for consumers to work with it. Having an easy-to-use schema is especially important when it is to be used across various teams in the same organization. Read on to find out how you can make your own GraphQL schemas easier to use and more scalable.

Advanced GraphQL Usage In Gatsby Websites

In this article, Aleem Isiaka goes into detail about GraphQL query constructs and how they are used with Gatsby. He also covers some advanced use cases for GraphQL in a Gatsby website by building out a fully featured blog site. Follow along with Aleem to learn more about how GraphQL works in the context of Gatsby.

Why we decided against GraphQL for local state management

In this article, Nick Brandt talks about why OkCupid decided against using GraphQL. Nick provides a great breakdown of what GraphQL is and why it's useful, including a discussion of how to think about state management with it. He then describes why OkCupid decided not to use GraphQL and the issues his team encountered. Read on to learn more about OkCupid's experience auditing GraphQL.

Articles

GraphQL on Azure: Part 4 - Serverless CosmosDB

In this article, Aaron Powell demonstrates how to build a GraphQL API that uses CosmosDB with Azure Functions. Specifically, Aaron shows how to use Azure's Function bindings--a way to have the Functions runtime provide you with a connection to another service in a read, write or read/write mode. Follow along with Aaron to find out how to build a GraphQL API with Azure Functions and CosnosDB.

Adding directives to the schema in code-first GraphQL servers

In this article, Leonardo Losoviz covers how to use schema directives in code-first GraphQL servers. A known drawback to building GraphQL APIs in a code-first fashion is that there is no natural support for Schema Directives. Follow along as Leonardo demonstrates how to use Schema Directives in a code-first GraphQL API built with GraphQL by PoP.

Journey to a Federated GraphQL

In this article, Artjom Kurapov covers how Pipedrive migrated to a federated GraphQL API. He talks about how they prepared for the transition, how they carried out the migration, and also the lessons they learned along the way. Check out this article to hear the story of how Pipedrive successfully carried out a move away from REST to GraphQL.

Articles

Why you should use Vue + GraphQL

In this article, Andy Li demonstrates how to create a simple GraphQL API and consume it in a Vue application. He talks about the problems that GraphQL solves, how it compares to REST, the tooling that exists to work with GraphQL, and how Vue factors in. Follow along with Andy to find out how to work with GraphQL APIs in a Vue app.

Getting Started with GraphQL in ASP.NET Core – Complete Guide

In this article, Mukesh Murugan talks about how to work with GraphQL in an ASP.NET Core application. He talks about what GraphQL is, how it compares to REST, and provides detailed guidance on how to set up a project. Follow along with Mukesh to learn how to build a GraphQL API using ASP.NET Core.

GraphQL Using the Apollo Framework: Getting Started

In this article, Felipe Laso-Marsetti demonstrates how to consume a GraphQL API in an iOS application in a type-safe way. He explains how to set up the project, create and run a GraphQL server, set up codegen, run queries, and much more. Follow along with Felipe to find out how to use GraphQL in an iOS application.

Articles

Ultimate Authentication using GraphQL Nexus

In this article, Muhammad Ali thoroughly covers how to add authentication to a Nexus GraphQL API. He goes into detail about how to add signup and login functionality, how to use OAuth 2.0 with providers like Facebook and Google, and how to manage user roles. Follow along with Muhammad to learn how to secure your Nexus GraphQL APIs.

Building Flutter apps with GraphQL in the backend

In this article, Ritesh Sharma guides us through how to build a Flutter app that uses a GraphQL API. He covers some high-level concepts of GraphQL backends including how to set up a schema and how to create resolvers. He then covers how to execute queries and mutations from a Flutter app. Follow along with Ritesh to find out how to use a GraphQL backend in your Flutter apps.

How to model hierarchical access with AppSync

In this article, Yan Cui describes his approach to modelling access control in AWS AppSync apps. He goes into detail about the challenges of modelling data access requirements, why it can be challenging to apply rules using the GraphQL SDL, and how this can be overcome using nested query and mutation types.

A Complete Walkthrough of GraphQL APIs with React and FaunaDB

In this article, Alex Lau covers how to build a React app backed by a GraphQL API that gets data from a FaunaDB database. He walks through how to provision the database, how to create the GraphQL Schema within FaunaDB, and how to deploy the app to Heroku. Follow along with Alex to discover how to back your GraphQL APIs with FaunaDB and consume the API in a React app.

How we improved a React Native app performance by using GraphQL and Relay

In this article, Felippe Rodrigo Puhle talks about how his team improved the performance of their React Native app by using GraphQL and Relay. He talks about how the app lacked memoized selectors and how Relay helped to implement them, how the team migrated only a portion of the app, and what the benchmarks show for improvement.

Articles

How GraphQL Nexus can help you create better APIs

In this article, Leonardo explains the benefits of the Nexus Schema – a declarative, code-first, and strongly typed GraphQL schema construction library. He delves into the difficulties in building GraphQL APIs and the tradeoffs between approaches to designing a GraphQL schema, namely Code-first and SDL-first. The article also demonstrates the different aspects of code-first schema construction with Nexus Schema. Check it out to get a better understanding of the different approaches.

How to Auth: Securing Your GraphQL API with Confidence

In this post, Mandi Wise goes on a tour of how authentication and authorization can be handled with a GraphQL API using Express and Apollo Server. Specifically, Mandi shows how to handle incoming JWTs in an Authorization header and pass that decoded data down the graph to resolvers. Additionally, how to keep authorization checks out of resolvers functions by abstracting them into a middleware layer. The post is based on the code Mandi demoed during GraphQL Summit 2020. You can find the link to the recording of the talk in the article.

Articles

How to Run GraphQL Directive-Driven Capacity Tests at Scale

Running peak capacity load testing across a full GraphQL API surface can be a challenge due to key differences with traditional REST / HTTP APIs. The optimal test scenario is to harvest live traffic and then replay it at scale to stress systems end-to-end and suss out issues. However, whether an operation is safe for capture and replay in the case of GraphQL isn't something you can derive from the HTTP envelope of requests and the standard HTTP verbs. In this article, Pat McCarthy describes a runtime directive-driven approach that Vrbo uses to effectively support weekly peak capacity tests across their production infrastructure. The testing has put Vrbo in a great position for dealing with load spikes effectively, and has led to major improvements in their end-to-end reliability across their customer journey.

Exposing GeoJSON and more through a GraphQL API

8base's GraphQL API now supports GeoFields, allowing developers to build location-based apps easily with built-in distance and bounds capabilities. This makes both filtering by geographical bounds/coordinates a breeze, as well as allows developers to return distance calculations in their API responses. In this article, Sebastian Scholl describes the new features added to 8base's GraphQL API and how developers can be successful using GeoFields. He goes into detail about how to apply location-based filtering and queries, how to do distance calculations, how to perform atomic operations, and more. Follow along to find out how you can use the new GeoFields features from 8base.

Articles

Testing GraphQL Backend in Product Hunt

In this article, Radoslav Stankov talks about how Product Hunt tests their GraphQL API using a set of Ruby testing helpers. He goes into detail about how his team tests three categories of API code, including helpers, mutation classes, and resolver classes. Follow along to find out how to test your Ruby GraphQL APIs so you can gain confidence that they work as expected.

Hasura – my first impressions on instant realtime GraphQL API

In this article, Sebastian Kurzynowski provides his impressions on using Hasura as a realtime GraphQL API and also gives a brief tutorial on how to get up and running with it. The tutorial demonstrates how to set up authentication, how to use the Hasura GraphQL engine, and how to use Hasura actions. Follow along to find out the benefits of using Hasura and how to get started.

Introducing Direct Lambda Resolvers: AWS AppSync GraphQL APIs without VTL

AWS has just released Direct Lambda Resolvers, a solution that allows developers to build an AWS AppSync GraphQL API without the need to learn and understand VTL templates. In this announcement article, Ed Lima walks through how AWS AppSync can be beneficial for creating GraphQL APIs, the problems that arise when needing to understand VTL templates, and how developers can now create resolver logic without any VTL.

A Guide to GraphQL Errors

In this article, Marc-André Giroux provides an in-depth guide on handling errors in GraphQL. The GraphQL community has not yet settled on standard conventions for errors which can cause confusion for developers when building a GraphQL app. Marc-André's guide helps to demystify common areas of confusion and provides readers with some established best practices for GraphQL error handling.

Articles

Build a production-grade API with Prisma and GraphQL

In this article, Gabriel Colson demonstrates how to build a real-world GraphQL API with Nexus Schema and Prisma. The tutorial provides a deep-dive on application architecture, project setup, and finally implementation. Follow along with Gabriel to learn how you can easily build production-ready GraphQL APIs backed by a type-safe database access layer using Prisma.

Building well-architected serverless applications: Controlling serverless API access – part 2

In this article, idk.dev covers how to add access control to a GraphQL API built on AWS AppSync. It goes into detail about how access control should be handled, how to have AppSync verify a JSON Web Token, how to handle API keys, and more. Follow along to find out how to secure your AWS AppSync GraphQL APIs.

Understanding Client-Side GraphQL With Apollo-Client In React Apps

In this article, Blessing Krofegha does a deep-dive into how to use Apollo Client in React applications. He outlines the basics of GraphQL and how Apollo Client fits into a React application. The tutorial takes readers through how to build a React app with Apollo Client and includes instructions on queries, mutations, and how to handle the cache.

Articles

Type Safe Infrastructure, Part 2 — GraphQL APIs with AWS AppSync

In the second part of his tutorial series, Samuel Goodwin demonstrates how to set up a GraphQL API hosted on AWS AppSync. He goes into detail about the benefits of AppSync as a managed service, what some of the downsides are, and how to create and deploy a GraphQL API on it. Follow along with Samuel for in-depth instructions on how to use GraphQL on AWS AppSync.

Building a Jamstack app with Nuxt, Vue and FaunaDB

FaunaDB is becoming an increasingly popular database choice for use with GraphQL. In this article, Rami Shashati shows how to build a full-stack application with Nuxt, Vue, and FaunaDB, all with GraphQL. Follow along for an end-to-end example of building a GraphQL app using these popular technologies.

Generating TypeScript types and React Hooks based on a GraphQL endpoint

In this brief tutorial, Danilo Woznica shows how to generate both TypeScript types and React hooks from a GraphQL schema. He talks about what graphql-codegen is, how to set it up in a new project, and how to configure it to output types from a given schema.

Using Apollo’s local cache for global state management with React+Typescript, codegen, and remote resolvers

In this tutorial, Mason Goetz covers how to use Apollo for global state management in a React application built with TypeScript. He covers how to set up local queries and mutations, how to use the GraphQL schema locally for type definitions and codegen, and how to use graphql-codegen to create custom hooks.

Articles

Announcing the Release of Apollo Client 3.0

Apollo has just announced the official release of Apollo Client 3.0. The major version bump brings package consolidation, improvements to the InMemoryCache APIs, improved local state management, and improvements to UI reactivity. Follow along as Ben Newman goes in-depth on the changes in Apollo Client 3.0, including some extensive code samples.

Search Kubernetes World with GraphQL

Searching through related Kubernetes resources can be complicated with existing tools. In this article, Hiroyuki Osaki explains why GraphQL is a good candidate for making this task simpler. He also demonstrates how to set up a working Kubernetes search client using GraphQL.

Articles

New Gatsby Source WordPress Plugin Now in Beta

Gatsby recently announced their new plugin for WordPress which is now in beta. One of the ways to use the plugin is with GraphQL using WPGraphQL by Jason Bahl. This article covers some of the technical details around the WPGraphQL plugin and how it interacts with WordPress data. Specifically, with the WPGraphQL plugin, WordPress can be used as a headless CMS. The article also gets into some of the motivations behind WPGraphQL and the benefits it offers over REST.