Credit: Jerel Miller (June 2024)
I've been experimenting with the two tools to compare codegen outputs and I was able to get a config for codegen that gets close to the apollo CLI's output. Unfortunately its not 100% 1:1. The biggest difference between the two is the name of the file you import from and unfortunately graphql-codegen isn't configurable in a way that allows you to name the files how the apollo codegen tool does. First the config, then I'll talk about it:This requires 1 preset and 2 plugins:
const config: CodegenConfig = {