Skip to content

Commit 860a87c

Browse files
authored
[Fusion] Used ARGUMENT instead of ARG in error codes (#8864)
1 parent 82f2a41 commit 860a87c

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryCodes.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ public static class LogEntryCodes
3535
public const string IsInvalidFieldType = "IS_INVALID_FIELD_TYPE";
3636
public const string IsInvalidSyntax = "IS_INVALID_SYNTAX";
3737
public const string IsInvalidUsage = "IS_INVALID_USAGE";
38-
public const string KeyDirectiveInFieldsArg = "KEY_DIRECTIVE_IN_FIELDS_ARG";
39-
public const string KeyFieldsHasArgs = "KEY_FIELDS_HAS_ARGS";
38+
public const string KeyDirectiveInFieldsArgument = "KEY_DIRECTIVE_IN_FIELDS_ARGUMENT";
39+
public const string KeyFieldsHasArguments = "KEY_FIELDS_HAS_ARGUMENTS";
4040
public const string KeyFieldsSelectInvalidType = "KEY_FIELDS_SELECT_INVALID_TYPE";
4141
public const string KeyInvalidFields = "KEY_INVALID_FIELDS";
4242
public const string KeyInvalidFieldsType = "KEY_INVALID_FIELDS_TYPE";
@@ -49,8 +49,8 @@ public static class LogEntryCodes
4949
public const string OutputFieldTypesNotMergeable = "OUTPUT_FIELD_TYPES_NOT_MERGEABLE";
5050
public const string OverrideFromSelf = "OVERRIDE_FROM_SELF";
5151
public const string OverrideOnInterface = "OVERRIDE_ON_INTERFACE";
52-
public const string ProvidesDirectiveInFieldsArg = "PROVIDES_DIRECTIVE_IN_FIELDS_ARG";
53-
public const string ProvidesFieldsHasArgs = "PROVIDES_FIELDS_HAS_ARGS";
52+
public const string ProvidesDirectiveInFieldsArgument = "PROVIDES_DIRECTIVE_IN_FIELDS_ARGUMENT";
53+
public const string ProvidesFieldsHasArguments = "PROVIDES_FIELDS_HAS_ARGUMENTS";
5454
public const string ProvidesFieldsMissingExternal = "PROVIDES_FIELDS_MISSING_EXTERNAL";
5555
public const string ProvidesInvalidFields = "PROVIDES_INVALID_FIELDS";
5656
public const string ProvidesInvalidFieldsType = "PROVIDES_INVALID_FIELDS_TYPE";

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/Logging/LogEntryHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ public static LogEntry KeyDirectiveInFieldsArgument(
627627
type.Name,
628628
schema.Name,
629629
string.Join(".", fieldNamePath))
630-
.SetCode(LogEntryCodes.KeyDirectiveInFieldsArg)
630+
.SetCode(LogEntryCodes.KeyDirectiveInFieldsArgument)
631631
.SetSeverity(LogSeverity.Error)
632632
.SetCoordinate(type.Coordinate)
633633
.SetTypeSystemMember(keyDirective)
@@ -647,7 +647,7 @@ public static LogEntry KeyFieldsHasArguments(
647647
type.Name,
648648
schema.Name,
649649
keyField.Coordinate.ToString())
650-
.SetCode(LogEntryCodes.KeyFieldsHasArgs)
650+
.SetCode(LogEntryCodes.KeyFieldsHasArguments)
651651
.SetSeverity(LogSeverity.Error)
652652
.SetCoordinate(type.Coordinate)
653653
.SetTypeSystemMember(keyDirective)
@@ -856,7 +856,7 @@ public static LogEntry ProvidesDirectiveInFieldsArgument(
856856
coordinate.ToString(),
857857
schema.Name,
858858
string.Join(".", fieldNamePath))
859-
.SetCode(LogEntryCodes.ProvidesDirectiveInFieldsArg)
859+
.SetCode(LogEntryCodes.ProvidesDirectiveInFieldsArgument)
860860
.SetSeverity(LogSeverity.Error)
861861
.SetCoordinate(coordinate)
862862
.SetTypeSystemMember(providesDirective)
@@ -878,7 +878,7 @@ public static LogEntry ProvidesFieldsHasArguments(
878878
coordinate.ToString(),
879879
schema.Name,
880880
providedField.Coordinate.ToString())
881-
.SetCode(LogEntryCodes.ProvidesFieldsHasArgs)
881+
.SetCode(LogEntryCodes.ProvidesFieldsHasArguments)
882882
.SetSeverity(LogSeverity.Error)
883883
.SetCoordinate(coordinate)
884884
.SetTypeSystemMember(providesDirective)

src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaValidationRules/KeyDirectiveInFieldsArgumentRuleTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type User @key(fields: "id name @lowercase") {
4040
"""
4141
{
4242
"message": "A @key directive on type 'User' in schema 'A' references field 'name', which must not include directive applications.",
43-
"code": "KEY_DIRECTIVE_IN_FIELDS_ARG",
43+
"code": "KEY_DIRECTIVE_IN_FIELDS_ARGUMENT",
4444
"severity": "Error",
4545
"coordinate": "User",
4646
"member": "key",
@@ -76,7 +76,7 @@ type FullName {
7676
"""
7777
{
7878
"message": "A @key directive on type 'User' in schema 'A' references field 'name.firstName', which must not include directive applications.",
79-
"code": "KEY_DIRECTIVE_IN_FIELDS_ARG",
79+
"code": "KEY_DIRECTIVE_IN_FIELDS_ARGUMENT",
8080
"severity": "Error",
8181
"coordinate": "User",
8282
"member": "key",
@@ -106,7 +106,7 @@ type User @key(fields: "id @example") @key(fields: "name @example") {
106106
"""
107107
{
108108
"message": "A @key directive on type 'User' in schema 'A' references field 'id', which must not include directive applications.",
109-
"code": "KEY_DIRECTIVE_IN_FIELDS_ARG",
109+
"code": "KEY_DIRECTIVE_IN_FIELDS_ARGUMENT",
110110
"severity": "Error",
111111
"coordinate": "User",
112112
"member": "key",
@@ -117,7 +117,7 @@ type User @key(fields: "id @example") @key(fields: "name @example") {
117117
"""
118118
{
119119
"message": "A @key directive on type 'User' in schema 'A' references field 'name', which must not include directive applications.",
120-
"code": "KEY_DIRECTIVE_IN_FIELDS_ARG",
120+
"code": "KEY_DIRECTIVE_IN_FIELDS_ARGUMENT",
121121
"severity": "Error",
122122
"coordinate": "User",
123123
"member": "key",

src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaValidationRules/KeyFieldsHasArgumentsRuleTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type User @key(fields: "id tags") {
3939
"""
4040
{
4141
"message": "A @key directive on type 'User' in schema 'A' references field 'User.tags', which must not have arguments.",
42-
"code": "KEY_FIELDS_HAS_ARGS",
42+
"code": "KEY_FIELDS_HAS_ARGUMENTS",
4343
"severity": "Error",
4444
"coordinate": "User",
4545
"member": "key",
@@ -71,7 +71,7 @@ type UserInfo {
7171
"""
7272
{
7373
"message": "A @key directive on type 'User' in schema 'A' references field 'UserInfo.tags', which must not have arguments.",
74-
"code": "KEY_FIELDS_HAS_ARGS",
74+
"code": "KEY_FIELDS_HAS_ARGUMENTS",
7575
"severity": "Error",
7676
"coordinate": "User",
7777
"member": "key",
@@ -99,7 +99,7 @@ type User @key(fields: "id") @key(fields: "tags") {
9999
"""
100100
{
101101
"message": "A @key directive on type 'User' in schema 'A' references field 'User.id', which must not have arguments.",
102-
"code": "KEY_FIELDS_HAS_ARGS",
102+
"code": "KEY_FIELDS_HAS_ARGUMENTS",
103103
"severity": "Error",
104104
"coordinate": "User",
105105
"member": "key",
@@ -110,7 +110,7 @@ type User @key(fields: "id") @key(fields: "tags") {
110110
"""
111111
{
112112
"message": "A @key directive on type 'User' in schema 'A' references field 'User.tags', which must not have arguments.",
113-
"code": "KEY_FIELDS_HAS_ARGS",
113+
"code": "KEY_FIELDS_HAS_ARGUMENTS",
114114
"severity": "Error",
115115
"coordinate": "User",
116116
"member": "key",

src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaValidationRules/ProvidesDirectiveInFieldsArgumentRuleTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ type Profile {
5252
"""
5353
{
5454
"message": "The @provides directive on field 'User.profile' in schema 'A' references field 'name', which must not include directive applications.",
55-
"code": "PROVIDES_DIRECTIVE_IN_FIELDS_ARG",
55+
"code": "PROVIDES_DIRECTIVE_IN_FIELDS_ARGUMENT",
5656
"severity": "Error",
5757
"coordinate": "User.profile",
5858
"member": "provides",
@@ -92,7 +92,7 @@ type ProfileInfo {
9292
"""
9393
{
9494
"message": "The @provides directive on field 'User.profile' in schema 'A' references field 'info.name', which must not include directive applications.",
95-
"code": "PROVIDES_DIRECTIVE_IN_FIELDS_ARG",
95+
"code": "PROVIDES_DIRECTIVE_IN_FIELDS_ARGUMENT",
9696
"severity": "Error",
9797
"coordinate": "User.profile",
9898
"member": "provides",
@@ -128,7 +128,7 @@ type Profile {
128128
"""
129129
{
130130
"message": "The @provides directive on field 'User.profile' in schema 'A' references field 'id', which must not include directive applications.",
131-
"code": "PROVIDES_DIRECTIVE_IN_FIELDS_ARG",
131+
"code": "PROVIDES_DIRECTIVE_IN_FIELDS_ARGUMENT",
132132
"severity": "Error",
133133
"coordinate": "User.profile",
134134
"member": "provides",
@@ -139,7 +139,7 @@ type Profile {
139139
"""
140140
{
141141
"message": "The @provides directive on field 'User.profile' in schema 'A' references field 'name', which must not include directive applications.",
142-
"code": "PROVIDES_DIRECTIVE_IN_FIELDS_ARG",
142+
"code": "PROVIDES_DIRECTIVE_IN_FIELDS_ARGUMENT",
143143
"severity": "Error",
144144
"coordinate": "User.profile",
145145
"member": "provides",

src/HotChocolate/Fusion-vnext/test/Fusion.Composition.Tests/SourceSchemaValidationRules/ProvidesFieldsHasArgumentsRuleTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type Article @key(fields: "id") {
5353
"""
5454
{
5555
"message": "The @provides directive on field 'Article.author' in schema 'A' references field 'User.tags', which must not have arguments.",
56-
"code": "PROVIDES_FIELDS_HAS_ARGS",
56+
"code": "PROVIDES_FIELDS_HAS_ARGUMENTS",
5757
"severity": "Error",
5858
"coordinate": "Article.author",
5959
"member": "provides",
@@ -95,7 +95,7 @@ type Article @key(fields: "id") {
9595
"""
9696
{
9797
"message": "The @provides directive on field 'Article.author' in schema 'A' references field 'UserInfo.tags', which must not have arguments.",
98-
"code": "PROVIDES_FIELDS_HAS_ARGS",
98+
"code": "PROVIDES_FIELDS_HAS_ARGUMENTS",
9999
"severity": "Error",
100100
"coordinate": "Article.author",
101101
"member": "provides",

0 commit comments

Comments
 (0)