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

Articles

Chaining Graphql Resolvers

This post breaks down the problems of GraphQL resolvers and offers some solutions by creating a chain of resolvers to satisfy individual parts of the overall problem. By doing so, these resolvers can be reused, tested easily and make code more expressive. Abhishek Saha demonstrates through sample code how chaining resolvers helps write schemas quickly to improve server side development.

Caching GraphQL Responses

To support offline capabilities, learn how to cache GraphQL responses by implementing a GraphQL caching in service workers with the caches API. Abdelrahman Awad explains the differences between caching as part of an application logic layer and caching as an enhancement layer, focusing more on the latter. The post also explains the fundamental distinctions between RESTful caching and GraphQL caching, and how GraphQL caching is transport agnostic.

Tutorials

GraphQL File Uploads with React Hooks, TypeScript & Amazon S3

This tutorial demonstrates step by step how to set up an Apollo Server with TypeScript for file uploads, set up your Apollo Client to upload files, pipe an uploaded file to AWS S3, and retrieve the URL of the uploaded file to save into a database. Given the multiple ways of performing file uploads (signed URL uploads, rolling your image server, etc.), this tutorial focuses on multipart upload requests.

Videos

Leveraging the Power of a Typed Schema: Dynamic User Interfaces with GraphQL

Reduce development time and create consistent and dynamic front-end interfaces which are always up-to-date with your back-end GraphQL API by utilizing the introspection query to reveal an API's schema, automatically generate queries and mutations, and, ultimately, hydrate typed React components. Check out Greg Brimble's presentation from Byteconf GraphQL 2020 where he details how to efficiently render GraphQL inputs and the use cases that come with a strongly typed schema.

GraphQL Pagination with Cursors in Apollo React

In this tutorial, Leigh Halliday walks through Cursor based GraphQL Pagination in Apollo React. Apollo provides a function made for fetching additional paginated results, and implementing cursor-based pagination on the client isn't all that different from offset-based pagination. Leigh live codes an example project and explains how, instead of using an absolute offset, we keep a reference to the last object fetched and information about the sort order used in order to apply cursor-based pagination.