graphql-client icon indicating copy to clipboard operation
graphql-client copied to clipboard

Allow deriving default on enums

Open Ten0 opened this issue 5 years ago • 0 comments

Sometimes there are mutations input structures with tons of options which we don't want to specify one by one which have an enums as field, and this: https://github.com/graphql-rust/graphql-client/blob/32cd3c75b1706233036fb0cd952f0135d8def245/graphql_client_codegen/src/codegen/enums.rs#L22

breaks compilation when using response_derives = "Default"/variables_derives = "Default" on these structures which depend on these enums, as the enums don't have default and hence we can't derive default on the other structures.

NOTE: as a workaround it is possible to manually impl Default for these structures somewhere else in the crate.

Ten0 avatar Jul 07 '20 11:07 Ten0