Skip to content

Commit 3b5022f

Browse files
committed
cargo fmt
1 parent e8a1e6d commit 3b5022f

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

graphql_client/tests/interfaces.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,18 @@ fn fragment_in_interface() {
104104
public_status: PublicStatus {
105105
display_name: false,
106106
},
107-
on: RustInterfaceWithFragmentQueryEverythingOn::Person(RustInterfaceWithFragmentQueryEverythingOnPerson {
108-
birthday: Some("1934-02-18".to_string()),
109-
})
107+
on: RustInterfaceWithFragmentQueryEverythingOn::Person(
108+
RustInterfaceWithFragmentQueryEverythingOnPerson {
109+
birthday: Some("1934-02-18".to_string()),
110+
}
111+
)
110112
},
111113
RustInterfaceWithFragmentQueryEverything {
112114
name: "Laïka".to_string(),
113115
public_status: PublicStatus { display_name: true },
114-
on: RustInterfaceWithFragmentQueryEverythingOn::Dog(RustInterfaceWithFragmentQueryEverythingOnDog {
115-
is_good_dog: true,
116-
})
116+
on: RustInterfaceWithFragmentQueryEverythingOn::Dog(
117+
RustInterfaceWithFragmentQueryEverythingOnDog { is_good_dog: true }
118+
)
117119
},
118120
RustInterfaceWithFragmentQueryEverything {
119121
name: "Mozilla".to_string(),
@@ -125,9 +127,9 @@ fn fragment_in_interface() {
125127
RustInterfaceWithFragmentQueryEverything {
126128
name: "Norbert".to_string(),
127129
public_status: PublicStatus { display_name: true },
128-
on: RustInterfaceWithFragmentQueryEverythingOn::Dog(RustInterfaceWithFragmentQueryEverythingOnDog {
129-
is_good_dog: true
130-
}),
130+
on: RustInterfaceWithFragmentQueryEverythingOn::Dog(
131+
RustInterfaceWithFragmentQueryEverythingOnDog { is_good_dog: true }
132+
),
131133
},
132134
])
133135
}

graphql_client_codegen/src/interfaces.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ pub struct GqlInterface {
2525

2626
impl GqlInterface {
2727
/// filters the selection to keep only the fields that refer to the interface's own.
28+
///
29+
/// This does not include the __typename field because it is translated into the `on` enum.
2830
fn object_selection(&self, selection: &Selection, query_context: &QueryContext) -> Selection {
2931
Selection(
3032
selection
@@ -239,7 +241,7 @@ mod tests {
239241

240242
assert_eq!(
241243
iface.object_selection(&selection, &context),
242-
Selection(vec![typename_field])
244+
Selection(vec![])
243245
);
244246
}
245247
}

0 commit comments

Comments
 (0)