Skip to content

Commit 6b1b212

Browse files
authored
nullable reference types support (#65)
1 parent 300efe2 commit 6b1b212

Some content is hidden

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

47 files changed

+211
-193
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 5.1.0.{build}
1+
version: 5.1.1.{build}
22
pull_requests:
33
do_not_increment_build_number: true
44
skip_tags: true

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "graphql-parser",
3-
"version": "5.1.0",
3+
"version": "5.1.1",
44
"main": "index.js",
55
"repository": "[email protected]:graphql-dotnet/parser.git",
66
"author": "Joe McBride",

src/Directory.Build.props

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<Project>
22

33
<PropertyGroup>
4-
<VersionPrefix>5.1.0</VersionPrefix>
4+
<VersionPrefix>5.1.1</VersionPrefix>
55
<Authors>Marek Magdziak</Authors>
66
<NoWarn>$(NoWarn);1591</NoWarn>
77
<Copyright>Copyright 2016-2020 Marek Magdziak et al. All rights reserved.</Copyright>
88
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
99
<LangVersion>latest</LangVersion>
10+
<Nullable>enable</Nullable>
1011
</PropertyGroup>
1112

1213
</Project>

src/GraphQLParser.ApiTests/ApiApprovalTests.Public_Api_Should_Not_Change_Inadvertently.approved.txt

Lines changed: 69 additions & 69 deletions
Large diffs are not rendered by default.

src/GraphQLParser.Benchmarks/ParserBenchmark.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ namespace GraphQLParser.Benchmarks
77
[RPlotExporter, CsvMeasurementsExporter]
88
public class ParserBenchmark
99
{
10-
private ILexemeCache _serial;
11-
private ILexemeCache _concurrent;
10+
private ILexemeCache? _serial;
11+
private ILexemeCache? _concurrent;
1212

1313
[GlobalSetup]
1414
public void GlobalSetup()

src/GraphQLParser.Tests/GraphQLParser.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.1</TargetFramework>
5-
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
5+
<Nullable>disable</Nullable>
66
</PropertyGroup>
77

88
<ItemGroup>

src/GraphQLParser/AST/ASTNode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ public abstract class ASTNode
66

77
public GraphQLLocation Location { get; set; }
88

9-
public GraphQLComment Comment { get; set; }
9+
public GraphQLComment? Comment { get; set; }
1010
}
1111
}

src/GraphQLParser/AST/GraphQLArgument.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ public class GraphQLArgument : ASTNode, INamedNode
44
{
55
public override ASTNodeKind Kind => ASTNodeKind.Argument;
66

7-
public GraphQLName Name { get; set; }
7+
public GraphQLName? Name { get; set; }
88

9-
public GraphQLValue Value { get; set; }
9+
public GraphQLValue? Value { get; set; }
1010
}
1111
}

src/GraphQLParser/AST/GraphQLDirective.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLDirective : ASTNode, INamedNode
66
{
7-
public List<GraphQLArgument> Arguments { get; set; }
7+
public List<GraphQLArgument>? Arguments { get; set; }
88

99
public override ASTNodeKind Kind => ASTNodeKind.Directive;
1010

11-
public GraphQLName Name { get; set; }
11+
public GraphQLName? Name { get; set; }
1212
}
1313
}

src/GraphQLParser/AST/GraphQLDirectiveDefinition.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
public class GraphQLDirectiveDefinition : GraphQLTypeDefinition
66
{
7-
public List<GraphQLInputValueDefinition> Arguments { get; set; }
7+
public List<GraphQLInputValueDefinition>? Arguments { get; set; }
88

9-
public List<GraphQLInputValueDefinition> Definitions { get; set; }
9+
public List<GraphQLInputValueDefinition>? Definitions { get; set; }
1010

1111
public override ASTNodeKind Kind => ASTNodeKind.DirectiveDefinition;
1212

13-
public List<GraphQLName> Locations { get; set; }
13+
public List<GraphQLName>? Locations { get; set; }
1414

1515
public bool Repeatable { get; set; }
1616
}

src/GraphQLParser/AST/GraphQLDocument.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLDocument : ASTNode
66
{
7-
public List<ASTNode> Definitions { get; set; }
7+
public List<ASTNode>? Definitions { get; set; }
88

99
public override ASTNodeKind Kind => ASTNodeKind.Document;
1010
}

src/GraphQLParser/AST/GraphQLEnumTypeDefinition.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLEnumTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
66
{
7-
public List<GraphQLDirective> Directives { get; set; }
7+
public List<GraphQLDirective>? Directives { get; set; }
88

99
public override ASTNodeKind Kind => ASTNodeKind.EnumTypeDefinition;
1010

11-
public List<GraphQLEnumValueDefinition> Values { get; set; }
11+
public List<GraphQLEnumValueDefinition>? Values { get; set; }
1212
}
1313
}

src/GraphQLParser/AST/GraphQLEnumValueDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLEnumValueDefinition : GraphQLTypeDefinition, IHasDirectivesNode
66
{
7-
public List<GraphQLDirective> Directives { get; set; }
7+
public List<GraphQLDirective>? Directives { get; set; }
88

99
public override ASTNodeKind Kind => ASTNodeKind.EnumValueDefinition;
1010
}

src/GraphQLParser/AST/GraphQLFieldDefinition.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLFieldDefinition : GraphQLTypeDefinition, IHasDirectivesNode
66
{
7-
public List<GraphQLInputValueDefinition> Arguments { get; set; }
7+
public List<GraphQLInputValueDefinition>? Arguments { get; set; }
88

9-
public List<GraphQLDirective> Directives { get; set; }
9+
public List<GraphQLDirective>? Directives { get; set; }
1010

1111
public override ASTNodeKind Kind => ASTNodeKind.FieldDefinition;
1212

13-
public GraphQLType Type { get; set; }
13+
public GraphQLType? Type { get; set; }
1414
}
1515
}

src/GraphQLParser/AST/GraphQLFieldSelection.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLFieldSelection : ASTNode, IHasDirectivesNode, INamedNode
66
{
7-
public GraphQLName Alias { get; set; }
7+
public GraphQLName? Alias { get; set; }
88

9-
public List<GraphQLArgument> Arguments { get; set; }
9+
public List<GraphQLArgument>? Arguments { get; set; }
1010

11-
public List<GraphQLDirective> Directives { get; set; }
11+
public List<GraphQLDirective>? Directives { get; set; }
1212

1313
public override ASTNodeKind Kind => ASTNodeKind.Field;
1414

15-
public GraphQLName Name { get; set; }
15+
public GraphQLName? Name { get; set; }
1616

17-
public GraphQLSelectionSet SelectionSet { get; set; }
17+
public GraphQLSelectionSet? SelectionSet { get; set; }
1818
}
1919
}

src/GraphQLParser/AST/GraphQLFragmentDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ public class GraphQLFragmentDefinition : GraphQLInlineFragment, INamedNode
44
{
55
public override ASTNodeKind Kind => ASTNodeKind.FragmentDefinition;
66

7-
public GraphQLName Name { get; set; }
7+
public GraphQLName? Name { get; set; }
88
}
99
}

src/GraphQLParser/AST/GraphQLFragmentSpread.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLFragmentSpread : ASTNode, IHasDirectivesNode, INamedNode
66
{
7-
public List<GraphQLDirective> Directives { get; set; }
7+
public List<GraphQLDirective>? Directives { get; set; }
88

99
public override ASTNodeKind Kind => ASTNodeKind.FragmentSpread;
1010

11-
public GraphQLName Name { get; set; }
11+
public GraphQLName? Name { get; set; }
1212
}
1313
}

src/GraphQLParser/AST/GraphQLInlineFragment.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
public class GraphQLInlineFragment : ASTNode, IHasDirectivesNode
66
{
7-
public List<GraphQLDirective> Directives { get; set; }
7+
public List<GraphQLDirective>? Directives { get; set; }
88

99
public override ASTNodeKind Kind => ASTNodeKind.InlineFragment;
1010

11-
public GraphQLSelectionSet SelectionSet { get; set; }
11+
public GraphQLSelectionSet? SelectionSet { get; set; }
1212

13-
public GraphQLNamedType TypeCondition { get; set; }
13+
public GraphQLNamedType? TypeCondition { get; set; }
1414
}
1515
}

src/GraphQLParser/AST/GraphQLInputObjectTypeDefinition.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
public class GraphQLInputObjectTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
66
{
7-
public List<GraphQLDirective> Directives { get; set; }
7+
public List<GraphQLDirective>? Directives { get; set; }
88

9-
public List<GraphQLInputValueDefinition> Fields { get; set; }
9+
public List<GraphQLInputValueDefinition>? Fields { get; set; }
1010

1111
public override ASTNodeKind Kind => ASTNodeKind.InputObjectTypeDefinition;
1212
}

src/GraphQLParser/AST/GraphQLInputValueDefinition.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLInputValueDefinition : GraphQLTypeDefinition, IHasDirectivesNode
66
{
7-
public GraphQLValue DefaultValue { get; set; }
7+
public GraphQLValue? DefaultValue { get; set; }
88

9-
public List<GraphQLDirective> Directives { get; set; }
9+
public List<GraphQLDirective>? Directives { get; set; }
1010

1111
public override ASTNodeKind Kind => ASTNodeKind.InputValueDefinition;
1212

13-
public GraphQLType Type { get; set; }
13+
public GraphQLType? Type { get; set; }
1414
}
1515
}

src/GraphQLParser/AST/GraphQLInterfaceTypeDefinition.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLInterfaceTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
66
{
7-
public List<GraphQLDirective> Directives { get; set; }
7+
public List<GraphQLDirective>? Directives { get; set; }
88

9-
public List<GraphQLFieldDefinition> Fields { get; set; }
9+
public List<GraphQLFieldDefinition>? Fields { get; set; }
1010

1111
public override ASTNodeKind Kind => ASTNodeKind.InterfaceTypeDefinition;
1212
}

src/GraphQLParser/AST/GraphQLListType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class GraphQLListType : GraphQLType
44
{
55
public override ASTNodeKind Kind => ASTNodeKind.ListType;
66

7-
public GraphQLType Type { get; set; }
7+
public GraphQLType? Type { get; set; }
88

99
public override string ToString() => $"[{Type}]";
1010
}

src/GraphQLParser/AST/GraphQLListValue.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public GraphQLListValue(ASTNodeKind kind)
1111
kindField = kind;
1212
}
1313

14-
public string AstValue { get; set; }
14+
public string? AstValue { get; set; }
1515

1616
public override ASTNodeKind Kind => kindField;
1717

18-
public List<GraphQLValue> Values { get; set; }
18+
public List<GraphQLValue>? Values { get; set; }
1919

20-
public override string ToString() => AstValue;
20+
public override string ToString() => AstValue!;
2121
}
2222
}

src/GraphQLParser/AST/GraphQLName.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ public class GraphQLName : ASTNode
77
{
88
public override ASTNodeKind Kind => ASTNodeKind.Name;
99

10-
public string Value { get; set; }
10+
public string? Value { get; set; }
1111
}
1212
}

src/GraphQLParser/AST/GraphQLNamedType.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ public class GraphQLNamedType : GraphQLType, INamedNode
44
{
55
public override ASTNodeKind Kind => ASTNodeKind.NamedType;
66

7-
public GraphQLName Name { get; set; }
7+
public GraphQLName? Name { get; set; }
88

9-
public override string ToString() => Name.Value;
9+
public override string ToString() => Name?.Value!;
1010
}
1111
}

src/GraphQLParser/AST/GraphQLNonNullType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class GraphQLNonNullType : GraphQLType
44
{
55
public override ASTNodeKind Kind => ASTNodeKind.NonNullType;
66

7-
public GraphQLType Type { get; set; }
7+
public GraphQLType? Type { get; set; }
88

99
public override string ToString() => Type + "!";
1010
}

src/GraphQLParser/AST/GraphQLObjectField.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ public class GraphQLObjectField : ASTNode, INamedNode
44
{
55
public override ASTNodeKind Kind => ASTNodeKind.ObjectField;
66

7-
public GraphQLName Name { get; set; }
7+
public GraphQLName? Name { get; set; }
88

9-
public GraphQLValue Value { get; set; }
9+
public GraphQLValue? Value { get; set; }
1010
}
1111
}

src/GraphQLParser/AST/GraphQLObjectTypeDefinition.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLObjectTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
66
{
7-
public List<GraphQLDirective> Directives { get; set; }
7+
public List<GraphQLDirective>? Directives { get; set; }
88

9-
public List<GraphQLFieldDefinition> Fields { get; set; }
9+
public List<GraphQLFieldDefinition>? Fields { get; set; }
1010

11-
public List<GraphQLNamedType> Interfaces { get; set; }
11+
public List<GraphQLNamedType>? Interfaces { get; set; }
1212

1313
public override ASTNodeKind Kind => ASTNodeKind.ObjectTypeDefinition;
1414
}

src/GraphQLParser/AST/GraphQLObjectValue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLObjectValue : GraphQLValue
66
{
7-
public List<GraphQLObjectField> Fields { get; set; }
7+
public List<GraphQLObjectField>? Fields { get; set; }
88

99
public override ASTNodeKind Kind => ASTNodeKind.ObjectValue;
1010
}

src/GraphQLParser/AST/GraphQLOperationDefinition.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLOperationDefinition : ASTNode, IHasDirectivesNode, INamedNode
66
{
7-
public List<GraphQLDirective> Directives { get; set; }
7+
public List<GraphQLDirective>? Directives { get; set; }
88

99
public override ASTNodeKind Kind => ASTNodeKind.OperationDefinition;
1010

11-
public GraphQLName Name { get; set; }
11+
public GraphQLName? Name { get; set; }
1212

1313
public OperationType Operation { get; set; }
1414

15-
public GraphQLSelectionSet SelectionSet { get; set; }
15+
public GraphQLSelectionSet? SelectionSet { get; set; }
1616

17-
public List<GraphQLVariableDefinition> VariableDefinitions { get; set; }
17+
public List<GraphQLVariableDefinition>? VariableDefinitions { get; set; }
1818
}
1919
}

src/GraphQLParser/AST/GraphQLOperationTypeDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ public class GraphQLOperationTypeDefinition : ASTNode
66

77
public OperationType Operation { get; set; }
88

9-
public GraphQLNamedType Type { get; set; }
9+
public GraphQLNamedType? Type { get; set; }
1010
}
1111
}

src/GraphQLParser/AST/GraphQLScalarTypeDefinition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace GraphQLParser.AST
44
{
55
public class GraphQLScalarTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
66
{
7-
public List<GraphQLDirective> Directives { get; set; }
7+
public List<GraphQLDirective>? Directives { get; set; }
88

99
public override ASTNodeKind Kind => ASTNodeKind.ScalarTypeDefinition;
1010
}

0 commit comments

Comments
 (0)