forked from graphql-dotnet/parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphQLFieldDefinition.cs
60 lines (48 loc) · 1.62 KB
/
GraphQLFieldDefinition.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
58
59
60
using System.Diagnostics;
namespace GraphQLParser.AST;
/// <summary>
/// AST node for <see cref="ASTNodeKind.FieldDefinition"/>.
/// </summary>
[DebuggerDisplay("GraphQLFieldDefinition: {Name}")]
public class GraphQLFieldDefinition : GraphQLTypeDefinition, IHasDirectivesNode, IHasArgumentsDefinitionNode
{
internal GraphQLFieldDefinition()
{
Type = null!;
}
/// <summary>
/// Creates a new instance of <see cref="GraphQLFieldDefinition"/>.
/// </summary>
public GraphQLFieldDefinition(GraphQLName name, GraphQLType type)
: base(name)
{
Type = type;
}
/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.FieldDefinition;
/// <summary>
/// Arguments for this field definition.
/// </summary>
public GraphQLArgumentsDefinition? Arguments { get; set; }
/// <summary>
/// Nested <see cref="GraphQLType"/> AST node with field type.
/// </summary>
public GraphQLType Type { get; set; }
/// <inheritdoc/>
public GraphQLDirectives? Directives { get; set; }
/// <inheritdoc />
public override bool IsChildDefinition => true;
}
internal sealed class GraphQLFieldDefinitionWithLocation : GraphQLFieldDefinition
{
public override GraphQLLocation Location { get; set; }
}
internal sealed class GraphQLFieldDefinitionWithComment : GraphQLFieldDefinition
{
public override List<GraphQLComment>? Comments { get; set; }
}
internal sealed class GraphQLFieldDefinitionFull : GraphQLFieldDefinition
{
public override GraphQLLocation Location { get; set; }
public override List<GraphQLComment>? Comments { get; set; }
}