Skip to content

isLegacyProjectConfig has logical error. #1416

@charleslai2000

Description

@charleslai2000

Issue workflow progress

Progress of the issue based on the Contributor Workflow

  • 1. The issue provides a reproduction available on GitHub, Stackblitz or CodeSandbox

    Make sure to fork this template and run pnpm run generate in the terminal.

    Please make sure the Codegen and plugins version under package.json matches yours.

  • 2. A failing test has been provided
  • 3. A local solution has been provided
  • 4. A pull request is pending review

The logic to decide whether a config is legacy has error.

To Reproduce
Steps to reproduce the behavior:

Correctly get new configuration.

Environment:

  • OS: Ubuntu 22.04
  • GraphQL Config Version: 5.0.2
  • NodeJS: 20
export class GraphQLProjectConfig {
    constructor({ filepath, name, config, extensionsRegistry, }) {
        this.filepath = filepath;
        this.dirpath = dirname(filepath);
        this.name = name;
        this.extensions = config.extensions || {};
        if (isLegacyProjectConfig(config)) {
            this.schema = config.schemaPath;
            this.include = config.includes;
            this.exclude = config.excludes;
            this.isLegacy = true;
        }
        else {
            this.schema = config.schema;
            this.documents = config.documents;
            this.include = config.include;
            this.exclude = config.exclude;
            this.isLegacy = false;
        }
        this._extensionsRegistry = extensionsRegistry;
    }

In this code, when project configuration has "include" or "exclude" keywords, is LegacyProjectConfig will return true. This is weird.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions