diff --git a/src/GraphQLParser.Benchmarks/Benchmarks/IBenchmark.cs b/src/GraphQLParser.Benchmarks/Benchmarks/IBenchmark.cs index efdcde5d..d3d222f6 100644 --- a/src/GraphQLParser.Benchmarks/Benchmarks/IBenchmark.cs +++ b/src/GraphQLParser.Benchmarks/Benchmarks/IBenchmark.cs @@ -2,7 +2,7 @@ namespace GraphQLParser.Benchmarks; internal interface IBenchmark { - void GlobalSetup(); + public void GlobalSetup(); - void Run(); + public void Run(); } diff --git a/src/GraphQLParser/AST/GraphQLName.cs b/src/GraphQLParser/AST/GraphQLName.cs index 3ebe512a..ae460470 100644 --- a/src/GraphQLParser/AST/GraphQLName.cs +++ b/src/GraphQLParser/AST/GraphQLName.cs @@ -8,8 +8,6 @@ namespace GraphQLParser.AST; [DebuggerDisplay("GraphQLName: {Value}")] public class GraphQLName : ASTNode, IHasValueNode, IEquatable { - private string? _string; - /// public override ASTNodeKind Kind => ASTNodeKind.Name; @@ -36,12 +34,14 @@ public string StringValue { get { - _string ??= Value.Length == 0 + field ??= Value.Length == 0 ? string.Empty : (string)Value; - return _string; + return field; } + + private set; } /// diff --git a/src/GraphQLParser/AST/Interfaces/IHasArgumentsDefinitionNode.cs b/src/GraphQLParser/AST/Interfaces/IHasArgumentsDefinitionNode.cs index 2ef2c785..db09d685 100644 --- a/src/GraphQLParser/AST/Interfaces/IHasArgumentsDefinitionNode.cs +++ b/src/GraphQLParser/AST/Interfaces/IHasArgumentsDefinitionNode.cs @@ -8,5 +8,5 @@ public interface IHasArgumentsDefinitionNode /// /// Arguments definition of the node represented as a nested node. /// - GraphQLArgumentsDefinition? Arguments { get; set; } + public GraphQLArgumentsDefinition? Arguments { get; set; } } diff --git a/src/GraphQLParser/AST/Interfaces/IHasArgumentsNode.cs b/src/GraphQLParser/AST/Interfaces/IHasArgumentsNode.cs index 37116fda..62abd17b 100644 --- a/src/GraphQLParser/AST/Interfaces/IHasArgumentsNode.cs +++ b/src/GraphQLParser/AST/Interfaces/IHasArgumentsNode.cs @@ -8,5 +8,5 @@ public interface IHasArgumentsNode /// /// Arguments of the node represented as a nested node. /// - GraphQLArguments? Arguments { get; set; } + public GraphQLArguments? Arguments { get; set; } } diff --git a/src/GraphQLParser/AST/Interfaces/IHasDescriptionNode.cs b/src/GraphQLParser/AST/Interfaces/IHasDescriptionNode.cs index ff018d3a..0e8166c2 100644 --- a/src/GraphQLParser/AST/Interfaces/IHasDescriptionNode.cs +++ b/src/GraphQLParser/AST/Interfaces/IHasDescriptionNode.cs @@ -9,5 +9,5 @@ public interface IHasDescriptionNode /// /// Description of a GraphQL definition. /// - GraphQLDescription? Description { get; set; } + public GraphQLDescription? Description { get; set; } } diff --git a/src/GraphQLParser/AST/Interfaces/IHasDirectivesNode.cs b/src/GraphQLParser/AST/Interfaces/IHasDirectivesNode.cs index 3804ce06..6715cfa7 100644 --- a/src/GraphQLParser/AST/Interfaces/IHasDirectivesNode.cs +++ b/src/GraphQLParser/AST/Interfaces/IHasDirectivesNode.cs @@ -8,5 +8,5 @@ public interface IHasDirectivesNode /// /// Directives of the AST node represented as a nested node. /// - GraphQLDirectives? Directives { get; set; } + public GraphQLDirectives? Directives { get; set; } } diff --git a/src/GraphQLParser/AST/Interfaces/IHasFieldsDefinitionNode.cs b/src/GraphQLParser/AST/Interfaces/IHasFieldsDefinitionNode.cs index 8d77fafe..4bc4df13 100644 --- a/src/GraphQLParser/AST/Interfaces/IHasFieldsDefinitionNode.cs +++ b/src/GraphQLParser/AST/Interfaces/IHasFieldsDefinitionNode.cs @@ -8,5 +8,5 @@ public interface IHasFieldsDefinitionNode /// /// Nested AST node with fields definition of this AST node. /// - GraphQLFieldsDefinition? Fields { get; set; } + public GraphQLFieldsDefinition? Fields { get; set; } } diff --git a/src/GraphQLParser/AST/Interfaces/IHasInterfacesNode.cs b/src/GraphQLParser/AST/Interfaces/IHasInterfacesNode.cs index 63e1cb47..851d7408 100644 --- a/src/GraphQLParser/AST/Interfaces/IHasInterfacesNode.cs +++ b/src/GraphQLParser/AST/Interfaces/IHasInterfacesNode.cs @@ -8,5 +8,5 @@ public interface IHasInterfacesNode /// /// Nested AST node with interfaces implemented by this AST node. /// - GraphQLImplementsInterfaces? Interfaces { get; set; } + public GraphQLImplementsInterfaces? Interfaces { get; set; } } diff --git a/src/GraphQLParser/AST/Interfaces/IHasSelectionSetNode.cs b/src/GraphQLParser/AST/Interfaces/IHasSelectionSetNode.cs index c26ac2fe..32b2f943 100644 --- a/src/GraphQLParser/AST/Interfaces/IHasSelectionSetNode.cs +++ b/src/GraphQLParser/AST/Interfaces/IHasSelectionSetNode.cs @@ -8,5 +8,5 @@ public interface IHasSelectionSetNode /// /// Nested AST node with selection set of this AST node. /// - GraphQLSelectionSet? SelectionSet { get; set; } + public GraphQLSelectionSet? SelectionSet { get; set; } } diff --git a/src/GraphQLParser/AST/Interfaces/IHasValueNode.cs b/src/GraphQLParser/AST/Interfaces/IHasValueNode.cs index b7a916e9..804cb95b 100644 --- a/src/GraphQLParser/AST/Interfaces/IHasValueNode.cs +++ b/src/GraphQLParser/AST/Interfaces/IHasValueNode.cs @@ -19,5 +19,5 @@ public interface IHasValueNode /// /// Value of AST node represented as . /// - ROM Value { get; } + public ROM Value { get; } } diff --git a/src/GraphQLParser/AST/Interfaces/INamedNode.cs b/src/GraphQLParser/AST/Interfaces/INamedNode.cs index cc5d96bd..10f7e04b 100644 --- a/src/GraphQLParser/AST/Interfaces/INamedNode.cs +++ b/src/GraphQLParser/AST/Interfaces/INamedNode.cs @@ -8,5 +8,5 @@ public interface INamedNode /// /// Name of the node represented as a nested AST node. /// - GraphQLName Name { get; set; } + public GraphQLName Name { get; set; } } diff --git a/src/GraphQLParser/Visitors/CountVisitor.cs b/src/GraphQLParser/Visitors/CountVisitor.cs index a3e006b6..9a901548 100644 --- a/src/GraphQLParser/Visitors/CountVisitor.cs +++ b/src/GraphQLParser/Visitors/CountVisitor.cs @@ -27,12 +27,12 @@ public interface ICountContext : IASTVisitorContext /// /// Number of found AST nodes. /// - int Count { get; set; } + public int Count { get; set; } /// /// Predicate used to increment . /// - Func ShouldInclude { get; } + public Func ShouldInclude { get; } } /// diff --git a/src/GraphQLParser/Visitors/IASTVisitorContext.cs b/src/GraphQLParser/Visitors/IASTVisitorContext.cs index 0295bf0c..8e38ad47 100644 --- a/src/GraphQLParser/Visitors/IASTVisitorContext.cs +++ b/src/GraphQLParser/Visitors/IASTVisitorContext.cs @@ -8,5 +8,5 @@ public interface IASTVisitorContext /// /// The token to monitor for cancellation requests. /// - CancellationToken CancellationToken { get; } + public CancellationToken CancellationToken { get; } } diff --git a/src/GraphQLParser/Visitors/IPrintContext.cs b/src/GraphQLParser/Visitors/IPrintContext.cs index 81b9a1b6..9c65df51 100644 --- a/src/GraphQLParser/Visitors/IPrintContext.cs +++ b/src/GraphQLParser/Visitors/IPrintContext.cs @@ -10,17 +10,17 @@ public interface IPrintContext : IASTVisitorContext /// /// A text writer to print document. /// - TextWriter Writer { get; } + public TextWriter Writer { get; } /// /// Stack of AST nodes to track the current visitor position. /// - Stack Parents { get; } + public Stack Parents { get; } /// /// Tracks the current indent level. /// - int IndentLevel { get; set; } + public int IndentLevel { get; set; } /// /// Indicates whether last GraphQL AST definition node (executable definition, @@ -29,22 +29,22 @@ public interface IPrintContext : IASTVisitorContext /// indents between definitions. /// [Obsolete("Use LastVisitedNode instead")] - bool LastDefinitionPrinted { get; set; } + public bool LastDefinitionPrinted { get; set; } /// /// Indicates whether last printed character was NewLine. This property is /// required to properly print indentations. /// - bool NewLinePrinted { get; set; } + public bool NewLinePrinted { get; set; } /// /// Indicates whether last printed characters were for horizontal indentation. /// It is assumed that the indentation is always printed after NewLine. /// - bool IndentPrinted { get; set; } + public bool IndentPrinted { get; set; } /// /// The last node visited by a printer. /// - ASTNode? LastVisitedNode { get; set; } + public ASTNode? LastVisitedNode { get; set; } } diff --git a/src/GraphQLParser/Visitors/MaxDepthVisitor.cs b/src/GraphQLParser/Visitors/MaxDepthVisitor.cs index 0243bdf9..9d32b372 100644 --- a/src/GraphQLParser/Visitors/MaxDepthVisitor.cs +++ b/src/GraphQLParser/Visitors/MaxDepthVisitor.cs @@ -35,12 +35,12 @@ public interface IMaxDepthContext : IASTVisitorContext /// /// Maximum depth of AST found. Minimum depth is 1. /// - int MaxDepth { get; set; } + public int MaxDepth { get; set; } /// /// Stack of AST nodes to track the current visitor position. /// - Stack Parents { get; } + public Stack Parents { get; } } ///