Skip to content

Commit 4dbd740

Browse files
committed
Fix missing docs for enum variants generated for dispatching GraphQL interface values
1 parent a487188 commit 4dbd740

File tree

1 file changed

+8
-1
lines changed
  • juniper_codegen/src/graphql_interface

1 file changed

+8
-1
lines changed

juniper_codegen/src/graphql_interface/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1730,8 +1730,15 @@ impl EnumType {
17301730

17311731
let variants = self.variants.iter().enumerate().map(|(n, ty)| {
17321732
let variant = Self::variant_ident(n);
1733+
let doc = format!(
1734+
"`{}` implementer of this GraphQL interface.",
1735+
quote! { #ty },
1736+
);
17331737

1734-
quote! { #variant(#ty), }
1738+
quote! {
1739+
#[doc = #doc]
1740+
#variant(#ty),
1741+
}
17351742
});
17361743

17371744
let phantom_variant = if self.has_phantom_variant() {

0 commit comments

Comments
 (0)