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

Add filter config to generate subset of schema #160

Open charlieforward9 opened 1 month ago

charlieforward9 commented 1 month ago

Hello!

In line with #143, I want to express my appreciation for providing this incredibly helpful code. Learning about it has been very enlightening and inspiring.

I would like to get all of my graphql logic generated, but there are certain operations/types in the schema that are not being generated properly, specifically input types that are not being codegen into API.ts by the amplify codegen process.

Screenshot 2024-05-10 at 7 41 58 PM

I am using Amplify and pulled the schema from the AppSync Schema Tab on the AWS Console.

Simplifying my target to only generating the models from the schema. Tried to filter the input types with a small custom plugin, but cant seem to get it working.

As I continue attempting, I would like to recommend that we add a config option to filter the undesired nodes out of the codegen. Better to have it as an option of this plugin then make a separate one.

Reviewing index.ts, I have made what I think is the necessary change to achieve in #159, but I would appreciate a good review to ensure I am not making a mistake.