Skip to content

Commit 389e155

Browse files
authored
Merge pull request #78 from ricred/fix-for-scalar-type-descriptions
Added support for newer HCL that does not set descriptions for scalar…
2 parents 035c296 + 90b826a commit 389e155

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Linq2GraphQL.Generator/Templates/Scalars/ScalarTemplate.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ public virtual string TransformText()
3737
#line default
3838
#line hidden
3939
this.Write(";\r\n\r\n /// <summary>\r\n /// ");
40-
40+
4141
#line 13 "C:\Data\Linq2GraphQL.Client-1\src\Linq2GraphQL.Generator\Templates\Scalars\ScalarTemplate.tt"
42-
this.Write(this.ToStringHelper.ToStringWithCulture(scalarType.SummaryDescription));
43-
42+
this.Write(this.ToStringHelper.ToStringWithCulture(scalarType.SummaryDescription ?? $"Represents the {scalarType.Name} scalar type"));
43+
4444
#line default
4545
#line hidden
4646
this.Write("\r\n /// </summary>\r\n [JsonConverter(typeof(CustomScalarConverter<");

src/Linq2GraphQL.Generator/Templates/Scalars/ScalarTemplate.tt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ using System.Text.Json.Serialization;
1010
namespace <#= namespaceName #>;
1111

1212
/// <summary>
13-
/// <#= scalarType.SummaryDescription #>
13+
/// <#= scalarType.SummaryDescription ?? $"Represents the {scalarType.ScalarTypeName} scalar type" #>
1414
/// </summary>
1515
[JsonConverter(typeof(CustomScalarConverter<<#= className #>>))]
1616
public partial class <#= className #> : CustomScalar {}

0 commit comments

Comments
 (0)