#[derive(cynic::QueryFragment, Debug, PartialEq)] #[cynic(schema_path = "../schemas/starwars.schema.graphql")] struct Film { /// Flatten some scalars #[cynic(rename = "producers", flatten)] producers_one: Vec, #[cynic(rename = "producers", flatten)] producers_two: Option>, } #[derive(cynic::QueryFragment, Debug, PartialEq)] #[cynic(schema_path = "../schemas/starwars.schema.graphql")] struct FilmCharactersConnection { /// Flatten some scalars #[cynic(rename = "edges", flatten)] edges_one: Vec, #[cynic(rename = "edges", flatten)] edges_two: Option>, } #[derive(cynic::QueryFragment, Debug, PartialEq)] #[cynic(schema_path = "../schemas/starwars.schema.graphql")] struct FilmCharactersEdge { cursor: String, } #[derive(cynic::QueryFragment, Debug, PartialEq)] #[cynic( schema_path = "../schemas/test_cases.graphql", schema_module = "schema_2" )] struct FlattenableEnums { /// Flatten some scalars #[cynic(rename = "states", flatten)] states: Vec, #[cynic(rename = "states", flatten)] states_two: Option>, } #[derive(cynic::Enum, Debug, PartialEq)] #[cynic( schema_path = "../schemas/test_cases.graphql", schema_module = "schema_2" )] enum States { Closed, Deleted, Open, } mod schema { cynic::use_schema!("../schemas/starwars.schema.graphql"); } mod schema_2 { cynic::use_schema!("../schemas/test_cases.graphql"); }