From 4dbd740fefd07d4a4ee668ee00822fbcd7fd4097 Mon Sep 17 00:00:00 2001 From: tyranron Date: Mon, 9 Nov 2020 13:40:24 +0100 Subject: [PATCH] Fix missing docs for enum variants generated for dispatching GraphQL interface values --- juniper_codegen/src/graphql_interface/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/juniper_codegen/src/graphql_interface/mod.rs b/juniper_codegen/src/graphql_interface/mod.rs index 94b07e84..4803e8e7 100644 --- a/juniper_codegen/src/graphql_interface/mod.rs +++ b/juniper_codegen/src/graphql_interface/mod.rs @@ -1730,8 +1730,15 @@ impl EnumType { let variants = self.variants.iter().enumerate().map(|(n, ty)| { let variant = Self::variant_ident(n); + let doc = format!( + "`{}` implementer of this GraphQL interface.", + quote! { #ty }, + ); - quote! { #variant(#ty), } + quote! { + #[doc = #doc] + #variant(#ty), + } }); let phantom_variant = if self.has_phantom_variant() {