timqian / gql-generator

Generate queries from graphql schema, used for writing api test.
MIT License
374 stars 93 forks source link

Possibility to add exluded fields #35

Open homoky opened 4 years ago

homoky commented 4 years ago

Hey,

it would be great if it would be possible to exclude some fields. For example ID or date fields that make conflicts with snapshots.

Now I solve it with bash script:

find ./tests/ -name *.gql -type f -exec sed -i '' -e "s/  updatedAt//" {} \;
find ./tests/ -name *.gql -type f -exec sed -i '' -e "s/  createdAt//" {} \;

It goes to every gql file and remove createdAt and updatedAt fields. The space before those two is because we do not want to strip out the arguments with the same name.

BottlecapDave commented 2 years ago

I would also find this useful, even more if it supported excluding fields which were more complex (e.g. an object)