forked from graphql-dotnet/parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphQLEnumValueDefinition.cs
57 lines (46 loc) · 1.66 KB
/
GraphQLEnumValueDefinition.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System.Diagnostics;
namespace GraphQLParser.AST;
/// <summary>
/// AST node for <see cref="ASTNodeKind.EnumValueDefinition"/>.
/// </summary>
[DebuggerDisplay("GraphQLEnumValueDefinition: {EnumValue}")]
public class GraphQLEnumValueDefinition : GraphQLTypeDefinition, IHasDirectivesNode
{
internal GraphQLEnumValueDefinition()
{
EnumValue = null!;
}
/// <summary>
/// Creates a new instance of <see cref="GraphQLEnumValueDefinition"/>.
/// </summary>
public GraphQLEnumValueDefinition(GraphQLName name, GraphQLEnumValue enumValue)
: base(name)
{
EnumValue = enumValue;
}
/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.EnumValueDefinition;
/// <summary>
/// Enum value represented as a nested AST node. Alas, inherited
/// <see cref="GraphQLTypeDefinition.Name"/> property holds almost
/// the same data and should be set as well.
/// </summary>
public GraphQLEnumValue EnumValue { get; set; }
/// <inheritdoc/>
public GraphQLDirectives? Directives { get; set; }
/// <inheritdoc />
public override bool IsChildDefinition => true;
}
internal sealed class GraphQLEnumValueDefinitionWithLocation : GraphQLEnumValueDefinition
{
public override GraphQLLocation Location { get; set; }
}
internal sealed class GraphQLEnumValueDefinitionWithComment : GraphQLEnumValueDefinition
{
public override List<GraphQLComment>? Comments { get; set; }
}
internal sealed class GraphQLEnumValueDefinitionFull : GraphQLEnumValueDefinition
{
public override GraphQLLocation Location { get; set; }
public override List<GraphQLComment>? Comments { get; set; }
}