forked from graphql-dotnet/parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraphQLDirectiveDefinition.cs
64 lines (53 loc) · 2.04 KB
/
GraphQLDirectiveDefinition.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
61
62
63
64
using System.Diagnostics;
namespace GraphQLParser.AST;
/// <summary>
/// AST node for <see cref="ASTNodeKind.DirectiveDefinition"/>.
/// </summary>
[DebuggerDisplay("GraphQLDirectiveDefinition: {Name}")]
public class GraphQLDirectiveDefinition : GraphQLTypeDefinition, IHasArgumentsDefinitionNode
{
internal GraphQLDirectiveDefinition()
{
Locations = null!;
}
/// <summary>
/// Creates a new instance of <see cref="GraphQLDirectiveDefinition"/>.
/// </summary>
public GraphQLDirectiveDefinition(GraphQLName name, GraphQLDirectiveLocations locations)
: base(name)
{
Locations = locations;
}
/// <inheritdoc/>
public override ASTNodeKind Kind => ASTNodeKind.DirectiveDefinition;
/// <summary>
/// Arguments for this directive definition.
/// </summary>
public GraphQLArgumentsDefinition? Arguments { 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; }
/// <summary>
/// Returns a node with a list of locations representing the valid locations this directive may be placed.
/// </summary>
public GraphQLDirectiveLocations Locations { get; set; }
}
internal sealed class GraphQLDirectiveDefinitionWithLocation : GraphQLDirectiveDefinition
{
public override GraphQLLocation Location { get; set; }
}
internal sealed class GraphQLDirectiveDefinitionWithComment : GraphQLDirectiveDefinition
{
public override List<GraphQLComment>? Comments { get; set; }
}
internal sealed class GraphQLDirectiveDefinitionFull : GraphQLDirectiveDefinition
{
public override GraphQLLocation Location { get; set; }
public override List<GraphQLComment>? Comments { get; set; }
}