-
-
Notifications
You must be signed in to change notification settings - Fork 725
/
IOperation.cs
102 lines (89 loc) · 3.14 KB
/
IOperation.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#nullable enable
using System;
using System.Collections.Generic;
using HotChocolate.Language;
using HotChocolate.Types;
namespace HotChocolate.Execution.Processing;
/// <summary>
/// Represents a compiled GraphQL operation.
/// </summary>
public interface IOperation : IHasReadOnlyContextData
{
/// <summary>
/// Gets the internal unique identifier for this operation.
/// </summary>
string Id { get; }
/// <summary>
/// Gets the parsed query document that contains the
/// operation-<see cref="Definition" />.
/// </summary>
DocumentNode Document { get; }
/// <summary>
/// Gets the syntax node representing the operation definition.
/// </summary>
OperationDefinitionNode Definition { get; }
/// <summary>
/// Gets the root type on which the operation is executed.
/// </summary>
ObjectType RootType { get; }
/// <summary>
/// Gets the name of the operation.
/// </summary>
string? Name { get; }
/// <summary>
/// Gets the operation type (Query, Mutation, Subscription).
/// </summary>
OperationType Type { get; }
/// <summary>
/// Gets the prepared root selections for this operation.
/// </summary>
/// <returns>
/// Returns the prepared root selections for this operation.
/// </returns>
ISelectionSet RootSelectionSet { get; }
/// <summary>
/// Gets all selection variants of this operation.
/// </summary>
IReadOnlyList<ISelectionVariants> SelectionVariants { get; }
/// <summary>
/// Gets the selection set for the specified <paramref name="selection"/> and
/// <paramref name="typeContext"/>.
/// </summary>
/// <param name="selection">
/// The selection set for which the selection set shall be resolved.
/// </param>
/// <param name="typeContext">
/// The result type context.
/// </param>
/// <returns>
/// Returns the selection set for the specified <paramref name="selection"/> and
/// <paramref name="typeContext"/>.
/// </returns>
/// <exception cref="ArgumentException">
/// The specified <paramref name="selection"/> has no selection set.
/// </exception>
ISelectionSet GetSelectionSet(ISelection selection, IObjectType typeContext);
/// <summary>
/// Gets the possible return types for the <paramref name="selection"/>.
/// </summary>
/// <param name="selection">
/// The selection for which the possible result types shall be returned.
/// </param>
/// <returns>
/// Returns the possible return types for the specified <paramref name="selection"/>.
/// </returns>
/// <exception cref="ArgumentException">
/// The specified <paramref name="selection"/> has no selection set.
/// </exception>
IEnumerable<IObjectType> GetPossibleTypes(ISelection selection);
/// <summary>
/// Creates the include flags for the specified variable values.
/// </summary>
/// <param name="variables">
/// The variable values.
/// </param>
/// <returns>
/// Returns the include flags for the specified variable values.
/// </returns>
long CreateIncludeFlags(IVariableValueCollection variables);
}