ardeois / graphql-codegen-typescript-mock-data

[GraphQL Codegen Plugin](https://github.com/dotansimha/graphql-code-generator) for building mock data based on the schema.
MIT License
134 stars 47 forks source link

Name convention #14

Closed molandim closed 4 years ago

molandim commented 4 years ago

By default typescript resolvers transform objects name to pascalCase. The same doesn't happen with the mocks functions.

I have an object called additionalInfo that typescript resolver transformed to AdditionalInfo but the mock generated is trying to import as lower case.

ardeois commented 4 years ago

Yes we follow Airbnb's convention where classes and types should be PascalCase, but function are camel case.

The mock function should then be named anAdditionalInfo

If that's not the case, feel free to open a PR, or provide some code to reproduce

ardeois commented 4 years ago

@molandim new option that could help you https://github.com/ardeois/graphql-codegen-typescript-mock-data#typenames-string-defaultvalue-pascal-casepascalcase