Skip to content

Commit 3150fe6

Browse files
Use auto properties and misc code cleanup (#398)
* Add .NET8 target * Adress (performance related) warnings (which are treated as errors) * Adress (performance related) warnings (which are treated as errors) * Chore: address minor warnings and clean up * Chore: use auto property syntax * Cleanups * Revert "Add .NET8 target" This reverts commit 2e384c6. * Chore: use auto property syntax * Chore: seal internal classes * Avoid async overhead in visitor methods * Address suggested code changes
1 parent c2583a5 commit 3150fe6

File tree

64 files changed

+267
-1594
lines changed

Some content is hidden

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

64 files changed

+267
-1594
lines changed

src/GraphQLParser/AST/Definitions/GraphQLArgumentsDefinition.cs

+4-27
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,17 @@ public GraphQLArgumentsDefinition(List<GraphQLInputValueDefinition> items)
2323

2424
internal sealed class GraphQLArgumentsDefinitionWithLocation : GraphQLArgumentsDefinition
2525
{
26-
private GraphQLLocation _location;
27-
28-
public override GraphQLLocation Location
29-
{
30-
get => _location;
31-
set => _location = value;
32-
}
26+
public override GraphQLLocation Location { get; set; }
3327
}
3428

3529
internal sealed class GraphQLArgumentsDefinitionWithComment : GraphQLArgumentsDefinition
3630
{
37-
private List<GraphQLComment>? _comments;
38-
39-
public override List<GraphQLComment>? Comments
40-
{
41-
get => _comments;
42-
set => _comments = value;
43-
}
31+
public override List<GraphQLComment>? Comments { get; set; }
4432
}
4533

4634
internal sealed class GraphQLArgumentsDefinitionFull : GraphQLArgumentsDefinition
4735
{
48-
private GraphQLLocation _location;
49-
private List<GraphQLComment>? _comments;
36+
public override GraphQLLocation Location { get; set; }
5037

51-
public override GraphQLLocation Location
52-
{
53-
get => _location;
54-
set => _location = value;
55-
}
56-
57-
public override List<GraphQLComment>? Comments
58-
{
59-
get => _comments;
60-
set => _comments = value;
61-
}
38+
public override List<GraphQLComment>? Comments { get; set; }
6239
}

src/GraphQLParser/AST/Definitions/GraphQLDirectiveDefinition.cs

+4-27
Original file line numberDiff line numberDiff line change
@@ -48,40 +48,17 @@ public GraphQLDirectiveDefinition(GraphQLName name, GraphQLDirectiveLocations lo
4848

4949
internal sealed class GraphQLDirectiveDefinitionWithLocation : GraphQLDirectiveDefinition
5050
{
51-
private GraphQLLocation _location;
52-
53-
public override GraphQLLocation Location
54-
{
55-
get => _location;
56-
set => _location = value;
57-
}
51+
public override GraphQLLocation Location { get; set; }
5852
}
5953

6054
internal sealed class GraphQLDirectiveDefinitionWithComment : GraphQLDirectiveDefinition
6155
{
62-
private List<GraphQLComment>? _comments;
63-
64-
public override List<GraphQLComment>? Comments
65-
{
66-
get => _comments;
67-
set => _comments = value;
68-
}
56+
public override List<GraphQLComment>? Comments { get; set; }
6957
}
7058

7159
internal sealed class GraphQLDirectiveDefinitionFull : GraphQLDirectiveDefinition
7260
{
73-
private GraphQLLocation _location;
74-
private List<GraphQLComment>? _comments;
61+
public override GraphQLLocation Location { get; set; }
7562

76-
public override GraphQLLocation Location
77-
{
78-
get => _location;
79-
set => _location = value;
80-
}
81-
82-
public override List<GraphQLComment>? Comments
83-
{
84-
get => _comments;
85-
set => _comments = value;
86-
}
63+
public override List<GraphQLComment>? Comments { get; set; }
8764
}

src/GraphQLParser/AST/Definitions/GraphQLEnumTypeDefinition.cs

+4-27
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,17 @@ public GraphQLEnumTypeDefinition(GraphQLName name)
3434

3535
internal sealed class GraphQLEnumTypeDefinitionWithLocation : GraphQLEnumTypeDefinition
3636
{
37-
private GraphQLLocation _location;
38-
39-
public override GraphQLLocation Location
40-
{
41-
get => _location;
42-
set => _location = value;
43-
}
37+
public override GraphQLLocation Location { get; set; }
4438
}
4539

4640
internal sealed class GraphQLEnumTypeDefinitionWithComment : GraphQLEnumTypeDefinition
4741
{
48-
private List<GraphQLComment>? _comments;
49-
50-
public override List<GraphQLComment>? Comments
51-
{
52-
get => _comments;
53-
set => _comments = value;
54-
}
42+
public override List<GraphQLComment>? Comments { get; set; }
5543
}
5644

5745
internal sealed class GraphQLEnumTypeDefinitionFull : GraphQLEnumTypeDefinition
5846
{
59-
private GraphQLLocation _location;
60-
private List<GraphQLComment>? _comments;
47+
public override GraphQLLocation Location { get; set; }
6148

62-
public override GraphQLLocation Location
63-
{
64-
get => _location;
65-
set => _location = value;
66-
}
67-
68-
public override List<GraphQLComment>? Comments
69-
{
70-
get => _comments;
71-
set => _comments = value;
72-
}
49+
public override List<GraphQLComment>? Comments { get; set; }
7350
}

src/GraphQLParser/AST/Definitions/GraphQLEnumValueDefinition.cs

+4-27
Original file line numberDiff line numberDiff line change
@@ -41,40 +41,17 @@ public GraphQLEnumValueDefinition(GraphQLName name, GraphQLEnumValue enumValue)
4141

4242
internal sealed class GraphQLEnumValueDefinitionWithLocation : GraphQLEnumValueDefinition
4343
{
44-
private GraphQLLocation _location;
45-
46-
public override GraphQLLocation Location
47-
{
48-
get => _location;
49-
set => _location = value;
50-
}
44+
public override GraphQLLocation Location { get; set; }
5145
}
5246

5347
internal sealed class GraphQLEnumValueDefinitionWithComment : GraphQLEnumValueDefinition
5448
{
55-
private List<GraphQLComment>? _comments;
56-
57-
public override List<GraphQLComment>? Comments
58-
{
59-
get => _comments;
60-
set => _comments = value;
61-
}
49+
public override List<GraphQLComment>? Comments { get; set; }
6250
}
6351

6452
internal sealed class GraphQLEnumValueDefinitionFull : GraphQLEnumValueDefinition
6553
{
66-
private GraphQLLocation _location;
67-
private List<GraphQLComment>? _comments;
54+
public override GraphQLLocation Location { get; set; }
6855

69-
public override GraphQLLocation Location
70-
{
71-
get => _location;
72-
set => _location = value;
73-
}
74-
75-
public override List<GraphQLComment>? Comments
76-
{
77-
get => _comments;
78-
set => _comments = value;
79-
}
56+
public override List<GraphQLComment>? Comments { get; set; }
8057
}

src/GraphQLParser/AST/Definitions/GraphQLEnumValuesDefinition.cs

+4-27
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,17 @@ public GraphQLEnumValuesDefinition(List<GraphQLEnumValueDefinition> items)
2323

2424
internal sealed class GraphQLEnumValuesDefinitionWithLocation : GraphQLEnumValuesDefinition
2525
{
26-
private GraphQLLocation _location;
27-
28-
public override GraphQLLocation Location
29-
{
30-
get => _location;
31-
set => _location = value;
32-
}
26+
public override GraphQLLocation Location { get; set; }
3327
}
3428

3529
internal sealed class GraphQLEnumValuesDefinitionWithComment : GraphQLEnumValuesDefinition
3630
{
37-
private List<GraphQLComment>? _comments;
38-
39-
public override List<GraphQLComment>? Comments
40-
{
41-
get => _comments;
42-
set => _comments = value;
43-
}
31+
public override List<GraphQLComment>? Comments { get; set; }
4432
}
4533

4634
internal sealed class GraphQLEnumValuesDefinitionFull : GraphQLEnumValuesDefinition
4735
{
48-
private GraphQLLocation _location;
49-
private List<GraphQLComment>? _comments;
36+
public override GraphQLLocation Location { get; set; }
5037

51-
public override GraphQLLocation Location
52-
{
53-
get => _location;
54-
set => _location = value;
55-
}
56-
57-
public override List<GraphQLComment>? Comments
58-
{
59-
get => _comments;
60-
set => _comments = value;
61-
}
38+
public override List<GraphQLComment>? Comments { get; set; }
6239
}

src/GraphQLParser/AST/Definitions/GraphQLFieldDefinition.cs

+4-27
Original file line numberDiff line numberDiff line change
@@ -44,40 +44,17 @@ public GraphQLFieldDefinition(GraphQLName name, GraphQLType type)
4444

4545
internal sealed class GraphQLFieldDefinitionWithLocation : GraphQLFieldDefinition
4646
{
47-
private GraphQLLocation _location;
48-
49-
public override GraphQLLocation Location
50-
{
51-
get => _location;
52-
set => _location = value;
53-
}
47+
public override GraphQLLocation Location { get; set; }
5448
}
5549

5650
internal sealed class GraphQLFieldDefinitionWithComment : GraphQLFieldDefinition
5751
{
58-
private List<GraphQLComment>? _comments;
59-
60-
public override List<GraphQLComment>? Comments
61-
{
62-
get => _comments;
63-
set => _comments = value;
64-
}
52+
public override List<GraphQLComment>? Comments { get; set; }
6553
}
6654

6755
internal sealed class GraphQLFieldDefinitionFull : GraphQLFieldDefinition
6856
{
69-
private GraphQLLocation _location;
70-
private List<GraphQLComment>? _comments;
57+
public override GraphQLLocation Location { get; set; }
7158

72-
public override GraphQLLocation Location
73-
{
74-
get => _location;
75-
set => _location = value;
76-
}
77-
78-
public override List<GraphQLComment>? Comments
79-
{
80-
get => _comments;
81-
set => _comments = value;
82-
}
59+
public override List<GraphQLComment>? Comments { get; set; }
8360
}

src/GraphQLParser/AST/Definitions/GraphQLFieldsDefinition.cs

+4-27
Original file line numberDiff line numberDiff line change
@@ -23,40 +23,17 @@ public GraphQLFieldsDefinition(List<GraphQLFieldDefinition> items)
2323

2424
internal sealed class GraphQLFieldsDefinitionWithLocation : GraphQLFieldsDefinition
2525
{
26-
private GraphQLLocation _location;
27-
28-
public override GraphQLLocation Location
29-
{
30-
get => _location;
31-
set => _location = value;
32-
}
26+
public override GraphQLLocation Location { get; set; }
3327
}
3428

3529
internal sealed class GraphQLFieldsDefinitionWithComment : GraphQLFieldsDefinition
3630
{
37-
private List<GraphQLComment>? _comments;
38-
39-
public override List<GraphQLComment>? Comments
40-
{
41-
get => _comments;
42-
set => _comments = value;
43-
}
31+
public override List<GraphQLComment>? Comments { get; set; }
4432
}
4533

4634
internal sealed class GraphQLFieldsDefinitionFull : GraphQLFieldsDefinition
4735
{
48-
private GraphQLLocation _location;
49-
private List<GraphQLComment>? _comments;
36+
public override GraphQLLocation Location { get; set; }
5037

51-
public override GraphQLLocation Location
52-
{
53-
get => _location;
54-
set => _location = value;
55-
}
56-
57-
public override List<GraphQLComment>? Comments
58-
{
59-
get => _comments;
60-
set => _comments = value;
61-
}
38+
public override List<GraphQLComment>? Comments { get; set; }
6239
}

src/GraphQLParser/AST/Definitions/GraphQLFragmentDefinition.cs

+4-27
Original file line numberDiff line numberDiff line change
@@ -40,39 +40,16 @@ public GraphQLFragmentDefinition(GraphQLFragmentName name, GraphQLTypeCondition
4040

4141
internal sealed class GraphQLFragmentDefinitionWithLocation : GraphQLFragmentDefinition
4242
{
43-
private GraphQLLocation _location;
44-
45-
public override GraphQLLocation Location
46-
{
47-
get => _location;
48-
set => _location = value;
49-
}
43+
public override GraphQLLocation Location { get; set; }
5044
}
5145

5246
internal sealed class GraphQLFragmentDefinitionWithComment : GraphQLFragmentDefinition
5347
{
54-
private List<GraphQLComment>? _comments;
55-
56-
public override List<GraphQLComment>? Comments
57-
{
58-
get => _comments;
59-
set => _comments = value;
60-
}
48+
public override List<GraphQLComment>? Comments { get; set; }
6149
}
6250
internal sealed class GraphQLFragmentDefinitionFull : GraphQLFragmentDefinition
6351
{
64-
private GraphQLLocation _location;
65-
private List<GraphQLComment>? _comments;
52+
public override GraphQLLocation Location { get; set; }
6653

67-
public override GraphQLLocation Location
68-
{
69-
get => _location;
70-
set => _location = value;
71-
}
72-
73-
public override List<GraphQLComment>? Comments
74-
{
75-
get => _comments;
76-
set => _comments = value;
77-
}
54+
public override List<GraphQLComment>? Comments { get; set; }
7855
}

0 commit comments

Comments
 (0)