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
133 stars 47 forks source link

Feature Request: allow specification/omit of the prefix #22

Closed 3nvi closed 4 years ago

3nvi commented 4 years ago

By default, the plugin specifies the prefix:

in all type-generating functions. This can lead to errors since words like User would become aUser, while words like Umbrella would also wrongly become aUmbrella.

In our app, we had a lot of types starting with the word Upload and it was a bit weird to see aUpload in all generators. For this reason, allowing the user to specify the prefix (while defaulting to what's already present) can help combat problems like that, while giving more flexibility.

At minimum, allowing the user to turn on or off this feature would be great!