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 .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ name: CodeQL analysis

on:
push:
branches: [master, develop]
branches: [master, develop, v8]
pull_request:
branches: [master, develop]
branches: [master, develop, v8]

jobs:
analyze:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- master
- develop
- v8
paths:
- src/**
- .github/workflows/**
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- develop
- v8
paths:
- src/**
- .github/workflows/**
Expand Down
6 changes: 6 additions & 0 deletions src/GraphQLParser.ApiTests/GraphQLParser.approved.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ namespace GraphQLParser.AST
public class GraphQLEnumValue : GraphQLParser.AST.GraphQLValue, GraphQLParser.AST.INamedNode
{
public GraphQLEnumValue() { }
public GraphQLEnumValue(GraphQLParser.AST.GraphQLName name) { }
public override GraphQLParser.AST.ASTNodeKind Kind { get; }
public GraphQLParser.AST.GraphQLName Name { get; set; }
}
Expand Down Expand Up @@ -240,6 +241,7 @@ namespace GraphQLParser.AST
public class GraphQLField : GraphQLParser.AST.ASTNode, GraphQLParser.AST.IHasArgumentsNode, GraphQLParser.AST.IHasDirectivesNode, GraphQLParser.AST.IHasSelectionSetNode, GraphQLParser.AST.INamedNode, GraphQLParser.AST.ISelectionNode
{
public GraphQLField() { }
public GraphQLField(GraphQLParser.AST.GraphQLName name) { }
public GraphQLParser.AST.GraphQLAlias? Alias { get; set; }
public GraphQLParser.AST.GraphQLArguments? Arguments { get; set; }
public GraphQLParser.AST.GraphQLDirectives? Directives { get; set; }
Expand Down Expand Up @@ -420,13 +422,15 @@ namespace GraphQLParser.AST
public class GraphQLObjectField : GraphQLParser.AST.ASTNode, GraphQLParser.AST.INamedNode
{
public GraphQLObjectField() { }
public GraphQLObjectField(GraphQLParser.AST.GraphQLName name, GraphQLParser.AST.GraphQLValue value) { }
public override GraphQLParser.AST.ASTNodeKind Kind { get; }
public GraphQLParser.AST.GraphQLName Name { get; set; }
public GraphQLParser.AST.GraphQLValue Value { get; set; }
}
public class GraphQLObjectTypeDefinition : GraphQLParser.AST.GraphQLTypeDefinition, GraphQLParser.AST.IHasDirectivesNode, GraphQLParser.AST.IHasFieldsDefinitionNode, GraphQLParser.AST.IHasInterfacesNode
{
public GraphQLObjectTypeDefinition() { }
public GraphQLObjectTypeDefinition(GraphQLParser.AST.GraphQLName name) { }
public GraphQLParser.AST.GraphQLDirectives? Directives { get; set; }
public GraphQLParser.AST.GraphQLFieldsDefinition? Fields { get; set; }
public GraphQLParser.AST.GraphQLImplementsInterfaces? Interfaces { get; set; }
Expand Down Expand Up @@ -492,6 +496,7 @@ namespace GraphQLParser.AST
public class GraphQLSelectionSet : GraphQLParser.AST.ASTNode
{
public GraphQLSelectionSet() { }
public GraphQLSelectionSet(System.Collections.Generic.List<GraphQLParser.AST.ASTNode> selections) { }
public override GraphQLParser.AST.ASTNodeKind Kind { get; }
public System.Collections.Generic.List<GraphQLParser.AST.ASTNode> Selections { get; set; }
}
Expand Down Expand Up @@ -520,6 +525,7 @@ namespace GraphQLParser.AST
public abstract class GraphQLTypeDefinition : GraphQLParser.AST.ASTNode, GraphQLParser.AST.IHasDescriptionNode, GraphQLParser.AST.INamedNode
{
protected GraphQLTypeDefinition() { }
protected GraphQLTypeDefinition(GraphQLParser.AST.GraphQLName name) { }
public GraphQLParser.AST.GraphQLDescription? Description { get; set; }
public GraphQLParser.AST.GraphQLName Name { get; set; }
}
Expand Down
15 changes: 15 additions & 0 deletions src/GraphQLParser/AST/Definitions/GraphQLObjectTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ namespace GraphQLParser.AST;
[DebuggerDisplay("GraphQLObjectTypeDefinition: {Name}")]
public class GraphQLObjectTypeDefinition : GraphQLTypeDefinition, IHasDirectivesNode, IHasInterfacesNode, IHasFieldsDefinitionNode
{
/// <summary>
/// Creates a new instance of <see cref="GraphQLObjectTypeDefinition"/>.
/// </summary>
public GraphQLObjectTypeDefinition()
{
}

/// <summary>
/// Creates a new instance of <see cref="GraphQLObjectTypeDefinition"/>.
/// </summary>
public GraphQLObjectTypeDefinition(GraphQLName name)
: base(name)
{
}

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

Expand Down
18 changes: 17 additions & 1 deletion src/GraphQLParser/AST/Definitions/GraphQLTypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,25 @@ namespace GraphQLParser.AST;
/// </summary>
public abstract class GraphQLTypeDefinition : ASTNode, INamedNode, IHasDescriptionNode
{
/// <summary>
/// Creates a new instance of <see cref="GraphQLTypeDefinition"/>.
/// </summary>
protected GraphQLTypeDefinition()
{
Name = null!;
}

/// <summary>
/// Creates a new instance of <see cref="GraphQLTypeDefinition"/>.
/// </summary>
protected GraphQLTypeDefinition(GraphQLName name)
{
Name = name;
}

/// <inheritdoc/>
public GraphQLDescription? Description { get; set; }

/// <inheritdoc/>
public GraphQLName Name { get; set; } = null!;
public GraphQLName Name { get; set; }
}
18 changes: 17 additions & 1 deletion src/GraphQLParser/AST/GraphQLField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ namespace GraphQLParser.AST;
/// </summary>
public class GraphQLField : ASTNode, ISelectionNode, IHasSelectionSetNode, IHasDirectivesNode, IHasArgumentsNode, INamedNode
{
/// <summary>
/// Creates a new instance of <see cref="GraphQLField"/>.
/// </summary>
public GraphQLField()
{
Name = null!;
}

/// <summary>
/// Creates a new instance of <see cref="GraphQLField"/>.
/// </summary>
public GraphQLField(GraphQLName name)
{
Name = name;
}

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

Expand All @@ -14,7 +30,7 @@ public class GraphQLField : ASTNode, ISelectionNode, IHasSelectionSetNode, IHasD
public GraphQLAlias? Alias { get; set; }

/// <inheritdoc/>
public GraphQLName Name { get; set; } = null!;
public GraphQLName Name { get; set; }

/// <summary>
/// Arguments for this field.
Expand Down
22 changes: 20 additions & 2 deletions src/GraphQLParser/AST/GraphQLObjectField.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,34 @@ namespace GraphQLParser.AST;
/// </summary>
public class GraphQLObjectField : ASTNode, INamedNode
{
/// <summary>
/// Creates a new instance of <see cref="GraphQLObjectField"/>.
/// </summary>
public GraphQLObjectField()
{
Name = null!;
Value = null!;
}

/// <summary>
/// Creates a new instance of <see cref="GraphQLObjectField"/>.
/// </summary>
public GraphQLObjectField(GraphQLName name, GraphQLValue value)
{
Name = name;
Value = value;
}

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

/// <inheritdoc/>
public GraphQLName Name { get; set; } = null!;
public GraphQLName Name { get; set; }

/// <summary>
/// Value of the field represented as a nested AST node.
/// </summary>
public GraphQLValue Value { get; set; } = null!;
public GraphQLValue Value { get; set; }
}

internal sealed class GraphQLObjectFieldWithLocation : GraphQLObjectField
Expand Down
18 changes: 17 additions & 1 deletion src/GraphQLParser/AST/GraphQLSelectionSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ namespace GraphQLParser.AST;
/// </summary>
public class GraphQLSelectionSet : ASTNode
{
/// <summary>
/// Creates a new instance of <see cref="GraphQLSelectionSet"/>.
/// </summary>
public GraphQLSelectionSet()
{
Selections = null!;
}

/// <summary>
/// Creates a new instance of <see cref="GraphQLSelectionSet"/>.
/// </summary>
public GraphQLSelectionSet(List<ASTNode> selections)
{
Selections = selections;
}

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

Expand All @@ -18,7 +34,7 @@ public class GraphQLSelectionSet : ASTNode
/// <item><see cref="GraphQLInlineFragment"/></item>
/// </list>
/// </summary>
public List<ASTNode> Selections { get; set; } = null!;
public List<ASTNode> Selections { get; set; }
}

internal sealed class GraphQLSelectionSetWithLocation : GraphQLSelectionSet
Expand Down
18 changes: 17 additions & 1 deletion src/GraphQLParser/AST/Values/GraphQLEnumValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,27 @@ namespace GraphQLParser.AST;
[DebuggerDisplay("GraphQLEnumValue: {Name}")]
public class GraphQLEnumValue : GraphQLValue, INamedNode
{
/// <summary>
/// Creates a new instance of <see cref="GraphQLEnumValue"/>.
/// </summary>
public GraphQLEnumValue()
{
Name = null!;
}

/// <summary>
/// Creates a new instance of <see cref="GraphQLEnumValue"/>.
/// </summary>
public GraphQLEnumValue(GraphQLName name)
{
Name = name;
}

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

/// <inheritdoc/>
public GraphQLName Name { get; set; } = null!;
public GraphQLName Name { get; set; }
}

internal sealed class GraphQLEnumValueWithLocation : GraphQLEnumValue
Expand Down