Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add xml documentation #115

Merged
merged 2 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
**master**<br/>[![Coverage Status](https://coveralls.io/repos/github/graphql-dotnet/parser/badge.svg?branch=master)](https://coveralls.io/github/graphql-dotnet/parser?branch=master)<br/>
**develop**<br/>[![Coverage Status](https://coveralls.io/repos/github/graphql-dotnet/parser/badge.svg?branch=develop)](https://coveralls.io/github/graphql-dotnet/parser?branch=develop)<br/>

<br/>

[![NuGet](https://img.shields.io/nuget/v/GraphQL-Parser.svg)](https://www.nuget.org/packages/GraphQL-Parser)
[![Nuget](https://img.shields.io/nuget/dt/GraphQL-Parser)](https://www.nuget.org/packages/GraphQL-Parser)

Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!-- https://github.com/clairernovotny/DeterministicBuilds -->
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">True</ContinuousIntegrationBuild>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<NoWarn>$(NoWarn);1591</NoWarn> <!--TODO: temporary solution-->
<NoWarn>$(NoWarn);1591</NoWarn> <!--TODO: temporary solution, remove-->
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
1 change: 0 additions & 1 deletion src/GraphQLParser.ApiTests/GraphQL-Parser.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ namespace GraphQLParser.AST
{
public GraphQLDirectiveDefinition() { }
public System.Collections.Generic.List<GraphQLParser.AST.GraphQLInputValueDefinition>? Arguments { get; set; }
public System.Collections.Generic.List<GraphQLParser.AST.GraphQLInputValueDefinition>? Definitions { get; set; }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was here by mistake. The property is not used anywhere.

public override GraphQLParser.AST.ASTNodeKind Kind { get; }
public System.Collections.Generic.List<GraphQLParser.AST.GraphQLName>? Locations { get; set; }
public bool Repeatable { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net5</TargetFramework>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser.Tests/GraphQLParser.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>net5;netcoreapp3.1</TargetFrameworks>
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
17 changes: 17 additions & 0 deletions src/GraphQLParser/AST/ASTNodeKind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,20 @@ public enum ASTNodeKind
ListValue,
ObjectValue,
ObjectField,

/// <summary>
/// Applied directive. Directives provide a way to describe alternate runtime execution
/// and type validation behavior in a GraphQL document. Directives can be used to describe
/// additional information for types, fields, fragments, operations, etc.
/// </summary>
Directive,
NamedType,
ListType,
NonNullType,

/// <summary>
/// Null values are represented as the keyword null.
/// </summary>
NullValue,
SchemaDefinition,
OperationTypeDefinition,
Expand All @@ -63,6 +73,13 @@ public enum ASTNodeKind
EnumValueDefinition,
InputObjectTypeDefinition,
TypeExtensionDefinition,

sungam3r marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Directive definition. Directives provide a way to describe alternate runtime execution
/// and type validation behavior in a GraphQL document. Directives can be used to describe
/// additional information for types, fields, fragments, operations, etc.
/// </summary>
DirectiveDefinition,

/// <summary>
Expand Down
5 changes: 3 additions & 2 deletions src/GraphQLParser/AST/GraphQLArgument.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class GraphQLArgument : ASTNode, INamedNode
/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.Argument;

/// <inheritdoc/>
public GraphQLName? Name { get; set; }

public GraphQLValue? Value { get; set; }
Expand All @@ -18,12 +19,12 @@ internal sealed class GraphQLArgumentFull : GraphQLArgument
public override GraphQLLocation Location
{
get => _location;
set => _location = value;
set => _location = value;
}

public override GraphQLComment? Comment
{
get => _comment;
get => _comment;
set => _comment = value;
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/GraphQLParser/AST/GraphQLDirective.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

namespace GraphQLParser.AST
{
/// <summary>
/// Represents a directive, applied to some GraphQL element.
/// </summary>
public class GraphQLDirective : ASTNode, INamedNode
{
public List<GraphQLArgument>? Arguments { get; set; }

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

/// <inheritdoc/>
public GraphQLName? Name { get; set; }
}

Expand Down
16 changes: 14 additions & 2 deletions src/GraphQLParser/AST/GraphQLDirectiveDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,29 @@

namespace GraphQLParser.AST
{
/// <summary>
/// Represents a directive definition.
/// </summary>
public class GraphQLDirectiveDefinition : GraphQLTypeDefinition
{
public List<GraphQLInputValueDefinition>? Arguments { get; set; }

public List<GraphQLInputValueDefinition>? Definitions { get; set; }

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

/// <summary>
/// Returns a list of locations representing the valid locations this directive may be placed.
/// </summary>
public List<GraphQLName>? Locations { get; set; }

/// <summary>
/// Indicates if the directive may be used repeatedly at a single location.
/// <br/><br/>
/// Repeatable directives are often useful when the same directive
/// should be used with different arguments at a single location,
/// especially in cases where additional information needs to be
/// provided to a type or schema extension via a directive
/// </summary>
public bool Repeatable { get; set; }
}

Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLEnumTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace GraphQLParser.AST
{
public class GraphQLEnumTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

/// <inheritdoc/>
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLEnumValueDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace GraphQLParser.AST
{
public class GraphQLEnumValueDefinition : GraphQLTypeDefinition, IHasDirectivesNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

/// <inheritdoc/>
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLFieldDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class GraphQLFieldDefinition : GraphQLTypeDefinition, IHasDirectivesNode
{
public List<GraphQLInputValueDefinition>? Arguments { get; set; }

/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

/// <inheritdoc/>
Expand Down
2 changes: 2 additions & 0 deletions src/GraphQLParser/AST/GraphQLFieldSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ public class GraphQLFieldSelection : ASTNode, IHasDirectivesNode, INamedNode

public List<GraphQLArgument>? Arguments { get; set; }

/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

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

/// <inheritdoc/>
public GraphQLName? Name { get; set; }

public GraphQLSelectionSet? SelectionSet { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLFragmentDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class GraphQLFragmentDefinition : GraphQLInlineFragment, INamedNode
/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.FragmentDefinition;

/// <inheritdoc/>
public GraphQLName? Name { get; set; }
}

Expand Down
2 changes: 2 additions & 0 deletions src/GraphQLParser/AST/GraphQLFragmentSpread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ namespace GraphQLParser.AST
{
public class GraphQLFragmentSpread : ASTNode, IHasDirectivesNode, INamedNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

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

/// <inheritdoc/>
public GraphQLName? Name { get; set; }
}

Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLInlineFragment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace GraphQLParser.AST
{
public class GraphQLInlineFragment : ASTNode, IHasDirectivesNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

/// <inheritdoc/>
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLInputObjectTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace GraphQLParser.AST
{
public class GraphQLInputObjectTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

public List<GraphQLInputValueDefinition>? Fields { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLInputValueDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class GraphQLInputValueDefinition : GraphQLTypeDefinition, IHasDirectives
{
public GraphQLValue? DefaultValue { get; set; }

/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

/// <inheritdoc/>
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLInterfaceTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace GraphQLParser.AST
{
public class GraphQLInterfaceTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

public List<GraphQLFieldDefinition>? Fields { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLNamedType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class GraphQLNamedType : GraphQLType, INamedNode
/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.NamedType;

/// <inheritdoc/>
public GraphQLName? Name { get; set; }

/// <inheritdoc/>
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLObjectField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class GraphQLObjectField : ASTNode, INamedNode
/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.ObjectField;

/// <inheritdoc/>
public GraphQLName? Name { get; set; }

public GraphQLValue? Value { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLObjectTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace GraphQLParser.AST
{
public class GraphQLObjectTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

public List<GraphQLFieldDefinition>? Fields { get; set; }
Expand Down
2 changes: 2 additions & 0 deletions src/GraphQLParser/AST/GraphQLOperationDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ namespace GraphQLParser.AST
{
public class GraphQLOperationDefinition : ASTNode, IHasDirectivesNode, INamedNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

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

/// <inheritdoc/>
public GraphQLName? Name { get; set; }

public OperationType Operation { get; set; }
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLScalarTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace GraphQLParser.AST
{
public class GraphQLScalarTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

/// <inheritdoc/>
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLSchemaDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace GraphQLParser.AST
{
public class GraphQLSchemaDefinition : ASTNode, IHasDirectivesNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

/// <inheritdoc/>
Expand Down
5 changes: 3 additions & 2 deletions src/GraphQLParser/AST/GraphQLTypeDefinition.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
namespace GraphQLParser.AST
namespace GraphQLParser.AST
{
public abstract class GraphQLTypeDefinition : ASTNode, INamedNode
{
/// <inheritdoc/>
public GraphQLName? Name { get; set; }
}
}
}
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLUnionTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace GraphQLParser.AST
{
public class GraphQLUnionTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode
{
/// <inheritdoc/>
public List<GraphQLDirective>? Directives { get; set; }

/// <inheritdoc/>
Expand Down
1 change: 1 addition & 0 deletions src/GraphQLParser/AST/GraphQLVariable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public class GraphQLVariable : GraphQLValue, INamedNode
/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.Variable;

/// <inheritdoc/>
public GraphQLName? Name { get; set; }
}

Expand Down
8 changes: 7 additions & 1 deletion src/GraphQLParser/AST/IHasDirectivesNode.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
using System.Collections.Generic;
using System.Collections.Generic;

namespace GraphQLParser.AST
{
/// <summary>
/// Represents an AST node that may have directives applied to it (type, argument, field, enum, etc.).
/// </summary>
public interface IHasDirectivesNode
{
/// <summary>
/// Directives of the node represented as a list of nested nodes.
/// </summary>
List<GraphQLDirective>? Directives { get; set; }
}
}
8 changes: 7 additions & 1 deletion src/GraphQLParser/AST/INamedNode.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
namespace GraphQLParser.AST
namespace GraphQLParser.AST
{
/// <summary>
/// Represents an AST node that has a name (type, argument, directive, field, operation, variable, etc.).
/// </summary>
public interface INamedNode
{
/// <summary>
/// Name of the node represented as a nested node.
/// </summary>
GraphQLName? Name { get; set; }
}
}