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.
Last updated on August 31, 2022