Skip to content

Commit ab7422a

Browse files
authored
Merge pull request #43 from Qluxzz/add-description-as-doc-comments-if-available
Add description as doc comments if available
2 parents 5daacd2 + fcf0f20 commit ab7422a

3 files changed

Lines changed: 461 additions & 343 deletions

File tree

src/Linq2GraphQL.Generator/GraphQLSchema/RootSchema.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ public class BaseField
127127
public string Name { get; set; }
128128
public string Description { get; set; }
129129

130+
public bool HasDescription => !string.IsNullOrEmpty(Description);
131+
130132
public string CSharpName => Name?.ToPascalCase();
131133

132134
public GraphqlType GraphqlType { get; set; }
@@ -280,6 +282,8 @@ public class BaseType
280282
public TypeKind Kind { get; set; }
281283
public string Description { get; set; }
282284

285+
public bool HasDescription => !string.IsNullOrEmpty(Description);
286+
283287
public string CSharpName => Name?.ToPascalCase();
284288
public string FileName => CSharpName + ".cs";
285289

@@ -407,7 +411,7 @@ public void SetGraphQLTypeDefinition()
407411

408412
private bool UseSharpNoneNull()
409413
{
410-
414+
411415
if (GeneratorSettings.Current.Nullable || NoneNull)
412416
{
413417
return NoneNull;

0 commit comments

Comments
 (0)