eddeee888 / graphql-code-generator-plugins

List of GraphQL Code Generator plugins that complements the official plugins.
MIT License
44 stars 10 forks source link

[BUG] `nonOptionalTypename` not inherited from base config #228

Open lensbart opened 5 months ago

lensbart commented 5 months ago

Describe the bug When using the following config:

import { defineConfig } from '@eddeee888/gcg-typescript-resolver-files'
import type { CodegenConfig } from '@graphql-codegen/cli'

export default {
    config: {
        nonOptionalTypename: true,
    },
    generates: {
        'apps/api/src/schema/': defineConfig({
            // ...
            typesPluginsConfig: {
                // ...
            },
        }),
    },
    schema: 'apps/api/src/schema/**/*',
} satisfies CodegenConfig

you’d expect nonOptionalTypename: true to be inherited by @eddeee888/gcg-typescript-resolver-files without having to specify it again in typesPluginsConfig. However, this is not the case.

Versions

0.7.2

Additional context

The workaround is easy: just supply the configuration option in typesPluginsConfig. Therefore, this issue is neither urgent nor important. However, I’m submitting it anyway, because the current default behaviour might be surprising or confusing to new users.

Thank you!