Skip to content

[BUG] type error when using types.PluginsConfigdisableFederationDirectiveAndSclarInjection #495

Closed

Description

@LongLiveCHIEF

Describe the bug
Error in configuration when using disableFederationDirectiveAndScalarInjection: true:

**To Reproduce**

```typescript
const config: CodegenConfig = {
	importExtension: '.js',
	hooks: {
		afterAllFileWrite: ['prettier --write']
	},
	generates: {
		'src/gql': defineConfig({
			mode: 'modules',
			disableFederationDirectiveAndScalarInjection: true,
			typesPluginsConfig: {
				nonOptionalTypename: false,
				useIndexSignature: true,
				federation: true,
				disableFederationDirectiveAndScalarInjection: true,
			}
		})
	}
}

Expected behavior

This is a configuration option of typescript-resolvers plugin to support federation v2 and avoid duplicate type declarations during validation.

I would expect that it is recognized and allowed in the configuration passed to defineconfig.typesPluingsConfig

Screenshots
If applicable, add screenshots to help explain your problem.

Versions

  • OS: [e.g. MacOS, Windows, Linux]
  • OS Version:
  • Package name and version:

Additional context
Add any other context about the problem here.

Activity

  1. eddeee888 commented on Sep 13, 2026

    @eddeee888
    Owner

    Hi @LongLiveCHIEF,

    Could you please try setting it up at root like this to see if it works:

    const config: CodegenConfig = {
      schema: '<path_to_your_schema>',
      config: {
        federation: true,
        disableFederationDirectiveAndScalarInjection: true // disableFederationDirectiveAndScalarInjection is at root, not in generates block
      },
      generates: {
        // ... 
      }
    }
    
  2. LongLiveCHIEF commented on Sep 13, 2026

    @LongLiveCHIEF
    Author

    Forgot to close this. Tried that about an hour after opening this issue and it worked.

    Sorry for not closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions