Skip to content

add plugin ignores index.ts when using client present #10210

@simPod

Description

@simPod

Which packages are impacted by your issue?

@graphql-codegen/add

Describe the bug

add plugin should add eslint-disable to generated files

{ [`add`]: { content: `/* eslint-disable */` } },

it does so except for index.ts

All files except index.ts has /* eslint-disable */ added to them

image

Your Example Website or App

See bellow

Steps to Reproduce the Bug or Issue

  • Run generate with config specified bellow
  • open generated index.ts

Expected behavior

/* eslint-disable */
export * from "./fragment-masking";
export * from "./gql";

Screenshots or Videos

No response

Platform

  • OS: macos

  • NodeJS: 22

  • graphql version: 16.3

    "@graphql-codegen/add": "^5.0.3",
    "@graphql-codegen/cli": "^5.0.3",
    "@graphql-codegen/client-preset": "^4.5.1",
    "@graphql-codegen/fragment-matcher": "^5.0.2",
    "@graphql-codegen/typescript": "^4.1.2",
    "@graphql-codegen/typescript-document-nodes": "^4.0.12",
    "@graphql-codegen/typescript-operations": "^4.4.0",
    "@graphql-codegen/typescript-react-apollo": "^4.3.2",

Codegen Config File

const config: CodegenConfig = {
  documents: 'src/**/*.graphql',
  generates: {
    './src/gql/': {
      preset: 'client',
    },
  },
  overwrite: true,
  schema: '../schema.graphqls',
  watch: false,
};

Additional context

No response

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