Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: there are multiple definitions for the getAllUser operation. Please fix all naming conflicts before continuing. #136

Open
zharinov-nikita opened this issue Dec 18, 2023 · 1 comment

Comments

@zharinov-nikita
Copy link

zharinov-nikita commented Dec 18, 2023

//apollo.config.cjs
module.exports = {
    client: {
        service: {
            name: 'backend',
            url: 'http://localhost:5555/graphql',
        }
    }
}
//codegent.ts
import type { CodegenConfig } from '@graphql-codegen/cli'

const config: CodegenConfig = {
    overwrite: true,
    schema: 'http://localhost:5555/graphql',
    documents: ['src/**/*.{ts,tsx}'],
    ignoreNoDocuments: true,
    watch: true,
    generates: {
        './src/00-shared/graphql/codegen.graphql.tsx': {
            plugins: [
                'typescript',
                'typescript-operations',
                'typescript-react-apollo',
            ],
            config: {
                withComponent: true,
            },
        },
    },
}

export default config

how do I exclude the file that is generated by codegen - to fix the error?

@zharinov-nikita zharinov-nikita changed the title Error: there are multiple definitions for the getAllAffiliatePrograms operation. Please fix all naming conflicts before continuing. Error: there are multiple definitions for the getAllUser operation. Please fix all naming conflicts before continuing. Dec 18, 2023
@antonfrolovsky
Copy link

@zharinov-nikita Add folder with the generated code to excludes section helps me.

Example:

apollo.config.cjs

module.exports = {
    client: {
        service: {
            name: 'backend',
            url: 'http://localhost:5555/graphql',
        }
        excludes: ['**/src/00-shared/**'],
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants