forked from graphql-dotnet/parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphQLFragmentDefinition.cs
55 lines (46 loc) · 1.69 KB
/
GraphQLFragmentDefinition.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
using System.Diagnostics;
namespace GraphQLParser.AST;
/// <summary>
/// AST node for <see cref="ASTNodeKind.FragmentDefinition"/>.
/// </summary>
[DebuggerDisplay("GraphQLFragmentDefinition: {FragmentName.Name.StringValue}")]
public class GraphQLFragmentDefinition : GraphQLExecutableDefinition
{
internal GraphQLFragmentDefinition()
{
FragmentName = null!;
TypeCondition = null!;
}
/// <summary>
/// Creates a new instance of <see cref="GraphQLFragmentDefinition"/>.
/// </summary>
public GraphQLFragmentDefinition(GraphQLFragmentName name, GraphQLTypeCondition typeCondition, GraphQLSelectionSet selectionSet)
: base(selectionSet)
{
FragmentName = name;
TypeCondition = typeCondition;
}
/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.FragmentDefinition;
/// <summary>
/// Fragment name represented as a nested AST node.
/// </summary>
public GraphQLFragmentName FragmentName { get; set; }
/// <summary>
/// Nested <see cref="GraphQLTypeCondition"/> AST node with type condition of this fragment.
/// </summary>
public GraphQLTypeCondition TypeCondition { get; set; }
}
internal sealed class GraphQLFragmentDefinitionWithLocation : GraphQLFragmentDefinition
{
public override GraphQLLocation Location { get; set; }
}
internal sealed class GraphQLFragmentDefinitionWithComment : GraphQLFragmentDefinition
{
public override List<GraphQLComment>? Comments { get; set; }
}
internal sealed class GraphQLFragmentDefinitionFull : GraphQLFragmentDefinition
{
public override GraphQLLocation Location { get; set; }
public override List<GraphQLComment>? Comments { get; set; }
}