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

Option to generate plain JS without types? #36

Closed FezVrasta closed 3 years ago

FezVrasta commented 3 years ago

Hi, is there any option to generate the mock data in plain JavaScript?

ardeois commented 3 years ago

Hi @FezVrasta no sorry there isn't But you could maybe run tsc on the file to convert it to plain javascript

FezVrasta commented 3 years ago

Is there any technical reason behind this behavior?

ardeois commented 3 years ago

Yes it's because this plugin is named typescript-mock-data and we generate types in the code directly. Feel free to fork this project and create a plugin javascript-mock-data maybe?

FezVrasta commented 3 years ago

No need to be rude.

ardeois commented 3 years ago

Sorry @FezVrasta I didn't mean to be rude, but we don't use any templating system so generating a different output, would require a huge refactor. Like many open source projects, it was done in few hours during a week end, so it's not perfect