GraphQL is a popular choice for building APIs, and in projects using TypeScript and Apollo Client, mapping GraphQL schema to types/interfaces using Ap

Migrating Apollo Codegen to GraphQL Code Generator

submited by
Style Pass
2024-05-13 01:30:05

GraphQL is a popular choice for building APIs, and in projects using TypeScript and Apollo Client, mapping GraphQL schema to types/interfaces using Apollo Codegen was common. However, the community now recommends using GraphQL Code Generator, which Rubrik has recently migrated to.

GraphQL has become a popular choice for building APIs in recent years. In projects using Typescript and Apollo Client, such as Rubrik’s, it is very helpful to map GraphQL schema to types and interfaces and one of the most popular tools for generating these types and interfaces based on a GraphQL schema is Apollo Codegen. However, the open-source community has recently deprecated Apollo Codegen and has recommended GraphQL Code Generator instead, which aims to provide a more flexible and customizable code generation experience.

At Rubrik, we have recently migrated from Apollo codegen to GraphQL Code Generator and if you're interested in doing the same, this guide will help you through the process. The migration was also inspired by the github issue created by one of the authors of GraphQL Code Generator.

Leave a Comment