timqian / gql-generator

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

Exclude Deprecated Fields #16

Closed bonham000 closed 5 years ago

bonham000 commented 5 years ago

Is it possible to exclude deprecated fields from the generated output?

timqian commented 5 years ago

Do you mean deprecate fields like this? https://www.apollographql.com/docs/graphql-tools/schema-directives

This should be possible, we can check if a field is deprecated here

https://github.com/modelo/gql-generator/blob/master/index.js#L98

It will be good to add such an option to let user ignore deprecated fields.

PR is welcomed

timqian commented 5 years ago

The issue is resolved by https://github.com/modelo/gql-generator/pull/18 and released in the new version of gql-generator(1.0.11)

https://www.npmjs.com/package/gql-generator