Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Convert model names to PascalCase or camelCase #54

Open
kayooliveira opened this issue Aug 6, 2022 · 1 comment
Open

Convert model names to PascalCase or camelCase #54

kayooliveira opened this issue Aug 6, 2022 · 1 comment

Comments

@kayooliveira
Copy link

Is there any way to convert model names to PascalCase or camelCase ?

Ex:

model user_posts {
     ...
}

convert to:

type UserPosts {
     ...
}
@yujonglee
Copy link
Member

Currently, we don't provide.

To support this,

  1. We need to accept cofig for this.

    if (output) {
    if (config?.customRules) {
    const module = await import(
    path.join(output, '..', config?.customRules)
    );
    config.customRules = module.default.rules;
    }
    const result = await generateGraphqlSchema(options.datamodel, config);

  2. Then convert name in formatter

    }): string => `${type} ${name} {\n${fields.join('\n')}\n}\n`;

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

No branches or pull requests

2 participants