Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/GraphQLParser.Benchmarks/Benchmarks/IBenchmark.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ namespace GraphQLParser.Benchmarks;

internal interface IBenchmark
{
void GlobalSetup();
public void GlobalSetup();

void Run();
public void Run();
}
8 changes: 4 additions & 4 deletions src/GraphQLParser/AST/GraphQLName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ namespace GraphQLParser.AST;
[DebuggerDisplay("GraphQLName: {Value}")]
public class GraphQLName : ASTNode, IHasValueNode, IEquatable<GraphQLName>
{
private string? _string;

/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.Name;

Expand All @@ -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;
}

/// <inheritdoc />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IHasArgumentsDefinitionNode
/// <summary>
/// Arguments definition of the node represented as a nested node.
/// </summary>
GraphQLArgumentsDefinition? Arguments { get; set; }
public GraphQLArgumentsDefinition? Arguments { get; set; }
}
2 changes: 1 addition & 1 deletion src/GraphQLParser/AST/Interfaces/IHasArgumentsNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IHasArgumentsNode
/// <summary>
/// Arguments of the node represented as a nested node.
/// </summary>
GraphQLArguments? Arguments { get; set; }
public GraphQLArguments? Arguments { get; set; }
}
2 changes: 1 addition & 1 deletion src/GraphQLParser/AST/Interfaces/IHasDescriptionNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ public interface IHasDescriptionNode
/// <summary>
/// Description of a GraphQL definition.
/// </summary>
GraphQLDescription? Description { get; set; }
public GraphQLDescription? Description { get; set; }
}
2 changes: 1 addition & 1 deletion src/GraphQLParser/AST/Interfaces/IHasDirectivesNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IHasDirectivesNode
/// <summary>
/// Directives of the AST node represented as a nested node.
/// </summary>
GraphQLDirectives? Directives { get; set; }
public GraphQLDirectives? Directives { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IHasFieldsDefinitionNode
/// <summary>
/// Nested <see cref="GraphQLFieldsDefinition"/> AST node with fields definition of this AST node.
/// </summary>
GraphQLFieldsDefinition? Fields { get; set; }
public GraphQLFieldsDefinition? Fields { get; set; }
}
2 changes: 1 addition & 1 deletion src/GraphQLParser/AST/Interfaces/IHasInterfacesNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IHasInterfacesNode
/// <summary>
/// Nested <see cref="GraphQLImplementsInterfaces"/> AST node with interfaces implemented by this AST node.
/// </summary>
GraphQLImplementsInterfaces? Interfaces { get; set; }
public GraphQLImplementsInterfaces? Interfaces { get; set; }
}
2 changes: 1 addition & 1 deletion src/GraphQLParser/AST/Interfaces/IHasSelectionSetNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IHasSelectionSetNode
/// <summary>
/// Nested <see cref="GraphQLSelectionSet"/> AST node with selection set of this AST node.
/// </summary>
GraphQLSelectionSet? SelectionSet { get; set; }
public GraphQLSelectionSet? SelectionSet { get; set; }
}
2 changes: 1 addition & 1 deletion src/GraphQLParser/AST/Interfaces/IHasValueNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ public interface IHasValueNode
/// <summary>
/// Value of AST node represented as <see cref="ROM"/>.
/// </summary>
ROM Value { get; }
public ROM Value { get; }
}
2 changes: 1 addition & 1 deletion src/GraphQLParser/AST/Interfaces/INamedNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface INamedNode
/// <summary>
/// Name of the node represented as a nested AST node.
/// </summary>
GraphQLName Name { get; set; }
public GraphQLName Name { get; set; }
}
4 changes: 2 additions & 2 deletions src/GraphQLParser/Visitors/CountVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public interface ICountContext : IASTVisitorContext
/// <summary>
/// Number of found AST nodes.
/// </summary>
int Count { get; set; }
public int Count { get; set; }

/// <summary>
/// Predicate used to increment <see cref="Count"/>.
/// </summary>
Func<ASTNode, bool> ShouldInclude { get; }
public Func<ASTNode, bool> ShouldInclude { get; }
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion src/GraphQLParser/Visitors/IASTVisitorContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public interface IASTVisitorContext
/// <summary>
/// The token to monitor for cancellation requests.
/// </summary>
CancellationToken CancellationToken { get; }
public CancellationToken CancellationToken { get; }
}
14 changes: 7 additions & 7 deletions src/GraphQLParser/Visitors/IPrintContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ public interface IPrintContext : IASTVisitorContext
/// <summary>
/// A text writer to print document.
/// </summary>
TextWriter Writer { get; }
public TextWriter Writer { get; }

/// <summary>
/// Stack of AST nodes to track the current visitor position.
/// </summary>
Stack<ASTNode> Parents { get; }
public Stack<ASTNode> Parents { get; }

/// <summary>
/// Tracks the current indent level.
/// </summary>
int IndentLevel { get; set; }
public int IndentLevel { get; set; }

/// <summary>
/// Indicates whether last GraphQL AST definition node (executable definition,
Expand All @@ -29,22 +29,22 @@ public interface IPrintContext : IASTVisitorContext
/// indents between definitions.
/// </summary>
[Obsolete("Use LastVisitedNode instead")]
bool LastDefinitionPrinted { get; set; }
public bool LastDefinitionPrinted { get; set; }

/// <summary>
/// Indicates whether last printed character was NewLine. This property is
/// required to properly print indentations.
/// </summary>
bool NewLinePrinted { get; set; }
public bool NewLinePrinted { get; set; }

/// <summary>
/// Indicates whether last printed characters were for horizontal indentation.
/// It is assumed that the indentation is always printed after NewLine.
/// </summary>
bool IndentPrinted { get; set; }
public bool IndentPrinted { get; set; }

/// <summary>
/// The last node visited by a printer.
/// </summary>
ASTNode? LastVisitedNode { get; set; }
public ASTNode? LastVisitedNode { get; set; }
}
4 changes: 2 additions & 2 deletions src/GraphQLParser/Visitors/MaxDepthVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ public interface IMaxDepthContext : IASTVisitorContext
/// <summary>
/// Maximum depth of AST found. Minimum depth is 1.
/// </summary>
int MaxDepth { get; set; }
public int MaxDepth { get; set; }

/// <summary>
/// Stack of AST nodes to track the current visitor position.
/// </summary>
Stack<ASTNode> Parents { get; }
public Stack<ASTNode> Parents { get; }
}

/// <summary>
Expand Down
Loading