graphql-rust / graphql-client

Typed, correct GraphQL requests and responses in Rust
Apache License 2.0
1.12k stars 152 forks source link

fragments_other_variant option is always on #446

Open frymawe opened 1 year ago

frymawe commented 1 year ago

The codegen option fragments_other_variant does not create any change in the code generated. The root cause I ran into was that the schema I was using actually had Other as one of the enumerations causing a conflict with the generated Other(&str). graphql_client_codegen/src/codegen/enums.rs Generates the Other(&str) without regard to the settings in options. It is probably a different issue, but coming up with a name less likely to collide than Other might be a good idea too.

slyons commented 6 months ago

I'm getting hit by this as well:

error[E0428]: the name `Other` is defined multiple times
  --> src/cmds/creds/ls.rs:29:10
   |
29 | #[derive(GraphQLQuery)]
   |          ^^^^^^^^^^^^ `Other` redefined here