typescript-resolvers plugin also supports Apollo Federation.
In order to use it, add
federation: true to your configuration:
generates: ./src/types.ts: plugins: - typescript - typescript-resolvers config: federation: true
It will make sure to add the required GraphQL directives to your codegen schema, and will generate a compatible resolvers signature for Apollo Federation.