-
-
Notifications
You must be signed in to change notification settings - Fork 725
/
ThrowHelper.cs
62 lines (57 loc) · 2.41 KB
/
ThrowHelper.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
using System;
using HotChocolate.Execution.Processing;
using HotChocolate.Language;
using HotChocolate.Stitching.Properties;
using static HotChocolate.Stitching.Properties.StitchingResources;
namespace HotChocolate.Stitching
{
internal static class ThrowHelper
{
public static InvalidOperationException BufferedRequest_VariableDoesNotExist(
string name) =>
new InvalidOperationException(string.Format(
ThrowHelper_BufferedRequest_VariableDoesNotExist,
name));
public static InvalidOperationException BufferedRequest_OperationNotFound(
DocumentNode document) =>
new InvalidOperationException(string.Format(
ThrowHelper_BufferedRequest_OperationNotFound,
document));
public static GraphQLException ArgumentScopedVariableResolver_InvalidArgumentName(
string variableName,
FieldNode fieldSelection,
Path path) =>
new GraphQLException(ErrorBuilder.New()
.SetMessage(
StitchingResources.ArgumentScopedVariableResolver_InvalidArgumentName,
variableName)
.SetCode(ErrorCodes.Stitching.ArgumentNotDefined)
.SetPath(path)
.AddLocation(fieldSelection)
.Build());
public static GraphQLException FieldScopedVariableResolver_InvalidFieldName(
string variableName,
FieldNode fieldSelection,
Path path) =>
new GraphQLException(ErrorBuilder.New()
.SetMessage(
StitchingResources.FieldScopedVariableResolver_InvalidFieldName,
variableName)
.SetCode(ErrorCodes.Stitching.FieldNotDefined)
.SetPath(path)
.AddLocation(fieldSelection)
.Build());
public static GraphQLException RootScopedVariableResolver_ScopeNotSupported(
string scopeName,
FieldNode fieldSelection,
Path path) =>
new GraphQLException(ErrorBuilder.New()
.SetMessage(
StitchingResources.RootScopedVariableResolver_ScopeNotSupported,
scopeName)
.SetCode(ErrorCodes.Stitching.ScopeNotDefined)
.SetPath(path)
.AddLocation(fieldSelection)
.Build());
}
}