Codegen
Codegen
  • Plugins
Contact us
Docs
    • Introduction
    • Installation
    • Development workflow
    • ESM TypeScript usage
    • Vanilla TypeScript
    • React Query
    • React / Vue
    • Angular
    • Svelte / Kit
    • Dart/Flutter
    • Apollo Server / GraphQL Yoga
    • Apollo Server / GraphQL Yoga with Server Preset
    • API Testing
    • GraphQL Modules
    • Further Reading
    • codegen.ts
    • schema field
    • documents field
    • plugin config
    • require field
    • Naming Convention
    • Lifecycle Hooks
    • Multi Project
    • Generated files colocation
    • Programmatic Usage
    • How does it work?
    • Profiler
    • Document Transform
    • VSCode Extension
    • Prettier & Linters
    • Apollo Federation
    • apollo-local-state
    • create-react-app
    • Gatsby
    • What are Plugins?
    • Plugin structure
    • Validate Configuration
    • Extend Schema
    • Using Visitor Pattern
    • Contributing
    • GraphQL-CLI Deprecation
    • v0.18 -> v1.0
    • v0.13 -> v0.17
    • v4.0 -> v5.0
    • typescript-operations and client-preset v5.0 -> v6.0
Question? Give us feedback →Edit this page on GitHub
DocumentationIntegrationsApollo Federation

Apollo Federation

The typescript-resolvers plugin also supports Apollo Federation.

To use it, add federation: true to your configuration:

import { CodegenConfig } from '@graphql-codegen/cli'
 
const config: CodegenConfig = {
  generates: {
    './src/types.ts': {
      plugins: ['typescript', 'typescript-resolvers'],
      config: { federation: true }
    }
  }
}
export default config

It will add the required GraphQL directives to your codegen schema and generate a compatible resolvers signature for Apollo Federation.

Prettier & Lintersapollo-local-state
Codegen

End-to-end type safety

Products

  • Hive
  • Hive Gateway
  • Yoga
  • Mesh
  • Codegen
  • Inspector
  • Envelop
  • SOFA
  • Scalars
  • GraphQL ESLint

Developer

  • Documentation
  • Hive Status
  • Hive Updates
  • Blog

Company

  • About
  • Brand Assets
  • Newsletter
OSS FriendsPricingContact Us
Cloud Security Alliance Star Level One Badge
GitHubDiscord

© 2026 The Guild