Skip to content

Commit a6ff714

Browse files
Merge branch 'code-generation-bugfix' into doc-comments-escape-xml-characters
2 parents 984a8c0 + c6ee75d commit a6ff714

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+965
-24
lines changed

Octokit.GraphQL.Core.Generation.UnitTests/EntityGenerationTests.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ public void Generates_Method_For_List_Field_With_Nullable_Enum_List_Arg()
10551055
[Fact]
10561056
public void Generates_Method_For_String_Field()
10571057
{
1058-
var expected = FormatMemberTemplate("public int? Foo(Arg<string>? bar = null) => null;");
1058+
var expected = FormatMemberTemplate("public int? Foo(Arg<string>? bar = null) => default;");
10591059

10601060
var model = new TypeModel
10611061
{
@@ -1087,7 +1087,7 @@ public void Generates_Method_For_String_Field()
10871087
[Fact]
10881088
public void Generates_Method_For_NonNull_String_Field()
10891089
{
1090-
var expected = FormatMemberTemplate("public int? Foo(Arg<string> bar) => null;");
1090+
var expected = FormatMemberTemplate("public int? Foo(Arg<string> bar) => default;");
10911091

10921092
var model = new TypeModel
10931093
{
@@ -1119,7 +1119,7 @@ public void Generates_Method_For_NonNull_String_Field()
11191119
[Fact]
11201120
public void Generates_Method_For_Scalar_Field()
11211121
{
1122-
var expected = FormatMemberTemplate("public int? Foo(Arg<int>? bar = null) => null;");
1122+
var expected = FormatMemberTemplate("public int? Foo(Arg<int>? bar = null) => default;");
11231123

11241124
var model = new TypeModel
11251125
{
@@ -1151,7 +1151,7 @@ public void Generates_Method_For_Scalar_Field()
11511151
[Fact]
11521152
public void Generates_Method_For_Deprecated_WithoutReason_Scalar_Field()
11531153
{
1154-
var expected = FormatMemberTemplate($@"[Obsolete(@""Old and unused"")]{Environment.NewLine} public int? Foo(Arg<int>? bar = null) => null;");
1154+
var expected = FormatMemberTemplate($@"[Obsolete(@""Old and unused"")]{Environment.NewLine} public int? Foo(Arg<int>? bar = null) => default;");
11551155

11561156
var model = new TypeModel
11571157
{
@@ -1185,7 +1185,7 @@ public void Generates_Method_For_Deprecated_WithoutReason_Scalar_Field()
11851185
[Fact]
11861186
public void Generates_Method_For_Deprecated_Scalar_Field()
11871187
{
1188-
var expected = FormatMemberTemplate($@"[Obsolete]{Environment.NewLine} public int? Foo(Arg<int>? bar = null) => null;");
1188+
var expected = FormatMemberTemplate($@"[Obsolete]{Environment.NewLine} public int? Foo(Arg<int>? bar = null) => default;");
11891189

11901190
var model = new TypeModel
11911191
{
@@ -1218,7 +1218,7 @@ public void Generates_Method_For_Deprecated_Scalar_Field()
12181218
[Fact]
12191219
public void Generates_Method_For_NonNull_Scalar_Field()
12201220
{
1221-
var expected = FormatMemberTemplate("public int Foo(Arg<int>? bar = null) => null;");
1221+
var expected = FormatMemberTemplate("public int Foo(Arg<int>? bar = null) => default;");
12221222

12231223
var model = new TypeModel
12241224
{
@@ -1250,7 +1250,7 @@ public void Generates_Method_For_NonNull_Scalar_Field()
12501250
[Fact]
12511251
public void Generates_Method_For_ID_Field()
12521252
{
1253-
var expected = FormatMemberTemplate("public ID? Foo(Arg<int>? bar = null) => null;");
1253+
var expected = FormatMemberTemplate("public ID? Foo(Arg<int>? bar = null) => default;");
12541254

12551255
var model = new TypeModel
12561256
{
@@ -1282,7 +1282,7 @@ public void Generates_Method_For_ID_Field()
12821282
[Fact]
12831283
public void Generates_Method_For_NonNull_ID_Field()
12841284
{
1285-
var expected = FormatMemberTemplate("public ID Foo(Arg<int>? bar = null) => null;");
1285+
var expected = FormatMemberTemplate("public ID Foo(Arg<int>? bar = null) => default;");
12861286

12871287
var model = new TypeModel
12881288
{

Octokit.GraphQL.Core.Generation.UnitTests/InterfaceGenerationTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public void Generates_Method_For_Scalar()
512512
{
513513
var expected = FormatMemberTemplate(
514514
"int? Foo(Arg<int>? bar = null);",
515-
"public int? Foo(Arg<int>? bar = null) => null;");
515+
"public int? Foo(Arg<int>? bar = null) => default;");
516516

517517
var model = new TypeModel
518518
{
@@ -546,7 +546,7 @@ public void Generates_Method_For_NonNull_Scalar()
546546
{
547547
var expected = FormatMemberTemplate(
548548
"int Foo(Arg<int>? bar = null);",
549-
"public int Foo(Arg<int>? bar = null) => null;");
549+
"public int Foo(Arg<int>? bar = null) => default;");
550550

551551
var model = new TypeModel
552552
{

Octokit.GraphQL.Core.Generation/EntityGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ private static string GenerateScalarMethod(FieldModel field, TypeModel type)
229229

230230
GenerateArguments(field, out string arguments, out string parameters);
231231

232-
return $"{obsoleteAttribute} public {csharpType} {name}({arguments}) => null;";
232+
return $"{obsoleteAttribute} public {csharpType} {name}({arguments}) => default;";
233233
}
234234

235235
private static string GenerateObjectMethod(FieldModel field, TypeModel type, string entityNamespace)

Octokit.GraphQL/Model/Actor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public StubIActor(Expression expression) : base(expression)
5050
{
5151
}
5252

53-
public string AvatarUrl(Arg<int>? size = null) => null;
53+
public string AvatarUrl(Arg<int>? size = null) => default;
5454

5555
public string Login { get; }
5656

Octokit.GraphQL/Model/AddProjectCardPayload.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public AddProjectCardPayload(Expression expression) : base(expression)
3131
/// <summary>
3232
/// The ProjectColumn
3333
/// **Upcoming Change on 2019-01-01 UTC**
34-
/// **Description:** Type for `projectColumn` will change from `Project!` to `Project`.
34+
/// **Description:** Type for `projectColumn` will change from `Project!` to `ProjectColumn`.
3535
/// **Reason:** In preparation for an upcoming change to the way we report mutation errors, non-nullable payload fields are becoming nullable.
3636
/// </summary>
3737
public Project ProjectColumn => this.CreateProperty(x => x.ProjectColumn, Octokit.GraphQL.Model.Project.Create);

Octokit.GraphQL/Model/App.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public App(Expression expression) : base(expression)
4141
/// A URL pointing to the app's logo.
4242
/// </summary>
4343
/// <param name="size">The size of the resulting image.</param>
44-
public string LogoUrl(Arg<int>? size = null) => null;
44+
public string LogoUrl(Arg<int>? size = null) => default;
4545

4646
/// <summary>
4747
/// The name of the app.

Octokit.GraphQL/Model/Bot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public Bot(Expression expression) : base(expression)
1919
/// A URL pointing to the GitHub App's public avatar.
2020
/// </summary>
2121
/// <param name="size">The size of the resulting square image.</param>
22-
public string AvatarUrl(Arg<int>? size = null) => null;
22+
public string AvatarUrl(Arg<int>? size = null) => default;
2323

2424
/// <summary>
2525
/// Identifies the date and time when the object was created.

Octokit.GraphQL/Model/CommentCannotUpdateReason.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,11 @@ public enum CommentCannotUpdateReason
4040
/// </summary>
4141
[EnumMember(Value = "VERIFIED_EMAIL_REQUIRED")]
4242
VerifiedEmailRequired,
43+
44+
/// <summary>
45+
/// You cannot update this comment
46+
/// </summary>
47+
[EnumMember(Value = "DENIED")]
48+
Denied,
4349
}
4450
}

Octokit.GraphQL/Model/CommitComment.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,21 @@ public CommitComment(Expression expression) : base(expression)
7272
/// </summary>
7373
public bool IncludesCreatedEdit { get; }
7474

75+
/// <summary>
76+
/// Returns whether or not a comment has been minimized.
77+
/// </summary>
78+
public bool IsMinimized { get; }
79+
7580
/// <summary>
7681
/// The moment the editor made the last edit
7782
/// </summary>
7883
public DateTimeOffset? LastEditedAt { get; }
7984

85+
/// <summary>
86+
/// Returns why the comment was minimized.
87+
/// </summary>
88+
public string MinimizedReason { get; }
89+
8090
/// <summary>
8191
/// Identifies the file path associated with the comment.
8292
/// </summary>
@@ -142,6 +152,11 @@ public CommitComment(Expression expression) : base(expression)
142152
/// </summary>
143153
public bool ViewerCanDelete { get; }
144154

155+
/// <summary>
156+
/// Check if the current viewer can minimize this object.
157+
/// </summary>
158+
public bool ViewerCanMinimize { get; }
159+
145160
/// <summary>
146161
/// Can user react to this subject
147162
/// </summary>

Octokit.GraphQL/Model/CommitHistoryConnection.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ public CommitHistoryConnection(Expression expression) : base(expression)
1515
{
1616
}
1717

18+
/// <summary>
19+
/// A list of edges.
20+
/// </summary>
1821
public IQueryableList<CommitEdge> Edges => this.CreateProperty(x => x.Edges);
1922

2023
/// <summary>

0 commit comments

Comments
 (0)