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

PR for correction import of types with correct typesPrefix including typesPrefix for enums #51

Closed kraegpoeth closed 2 years ago

kraegpoeth commented 3 years ago

Hi @ardeois !

Super cool library, we are looking to use this in our production setup. Found a couple bugs though so would like to open a PR for feature changes. Let me know what you think! Fixes

I've fixed these locally - how to contribute? :)

Ps. Should probably add another config var enumsPrefix as this correctly mirrors the config settings of typescript-operations plugin (see typesPrefix and enumsPrefix)

pps. how come you are not listed in the official graphql-codegen plugin list!? You deserve that! 🙏

ardeois commented 3 years ago

@kraegpoeth thanks for the feedback

Yes it makes sense to add enumsPrefix similar to typescript-operations-plugin As for the import types, it's probably a bug, I didn't see the issue in my use case.

To contribute you can fork the repository and open a PR. I suggest to open 1 PR for each use case. Make sure to add unit tests as well please.

pps. how come you are not listed in the official graphql-codegen plugin list!? You deserve that! 🙏

Haha thanks, I should probably contact them and hand over the ownership of the repo. But to be honest I'm not very proud of the code itself, I developed this project on my spare time and didn't give enough love in term of code quality

jordan-paz commented 3 years ago

Import of types from generated.ts does not correctly add typesPrefix.

I'm having this same issue. @kraegpoeth would you mind sharing your solution? 🙏

ardeois commented 2 years ago

@kraegpoeth this PR should fix the first part of your issue I'll check for enumsPrefix what I can do

ardeois commented 2 years ago

@kraegpoeth enumsPrefix added in version 1.6.0