-
-
Notifications
You must be signed in to change notification settings - Fork 725
/
ITypeCompletionContext.cs
70 lines (59 loc) · 2.14 KB
/
ITypeCompletionContext.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
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using HotChocolate.Resolvers;
using HotChocolate.Types;
using HotChocolate.Types.Descriptors;
#nullable enable
namespace HotChocolate.Configuration
{
public interface ITypeCompletionContext
: ITypeSystemObjectContext
{
/// <summary>
/// Defines if the type that is being completed is the query type.
/// </summary>
bool? IsQueryType { get; }
IReadOnlyList<FieldMiddleware> GlobalComponents { get; }
IsOfTypeFallback? IsOfType { get; }
/// <summary>
/// Tries to resolve a type by its <paramref name="typeRef" />.
/// </summary>
/// <typeparam name="T">
/// The expected type.
/// </typeparam>
/// <param name="typeRef">
/// The type reference representing the type.
/// </param>
/// <param name="type">
/// The resolved types.
/// </param>
/// <returns>
/// <c>true</c> if the type has been resolved; otherwise, <c>false</c>.
/// </returns>
bool TryGetType<T>(ITypeReference typeRef, [NotNullWhen(true)] out T type) where T : IType;
/// <summary>
/// Gets a type by it's type reference.
/// </summary>
/// <param name="typeRef">
/// The type reference representing the type.
/// </param>
/// <typeparam name="T">
/// The expected type.
/// </typeparam>
/// <returns>
/// The resolved types.
/// </returns>
/// <exception cref="SchemaException">
/// The type could not be resolved for the given <paramref name="typeRef" />.
/// </exception>
T GetType<T>(ITypeReference typeRef) where T : IType;
IEnumerable<T> GetTypes<T>() where T : IType;
bool TryGetDirectiveType(
IDirectiveReference directiveRef,
[NotNullWhen(true)] out DirectiveType? directiveType);
DirectiveType GetDirectiveType(IDirectiveReference directiveRef);
FieldResolver GetResolver(NameString fieldName);
Func<ISchema> GetSchemaResolver();
}
}