Skip to content

Commit a60feed

Browse files
authored
[Fusion] Aligned "IsInvalidSyntaxRule" with the specification (#8777)
1 parent cdba759 commit a60feed

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaValidationRules/IsInvalidSyntaxRule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ namespace HotChocolate.Fusion.SourceSchemaValidationRules;
66

77
/// <summary>
88
/// The <c>@is</c> directive’s <c>field</c> argument must be syntactically valid GraphQL. If
9-
/// the selection map string is malformed (e.g., missing closing braces, unbalanced quotes, invalid
10-
/// tokens), then the schema cannot be composed correctly. In such cases, the error
9+
/// the <c>FieldSelectionMap</c> string is malformed (e.g., missing closing braces, unbalanced
10+
/// quotes, invalid tokens), then the schema cannot be composed correctly. In such cases, the error
1111
/// <c>IS_INVALID_SYNTAX</c> is raised.
1212
/// </summary>
1313
/// <seealso href="https://graphql.github.io/composite-schemas-spec/draft/#sec-Is-Invalid-Syntax">

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ public static TheoryData<string[]> ValidExamplesData()
4848
{
4949
return new TheoryData<string[]>
5050
{
51-
// In the following example, the @is directive’s "field" argument is a valid selection
52-
// map and satisfies the rule.
51+
// In the following example, the @is directive’s "field" argument is a valid
52+
// FieldSelectionMap and satisfies the rule.
5353
{
5454
[
5555
"""
5656
type Query {
57-
personById(id: ID! @is(field: "id")): Person @lookup
57+
product(id: ID! @is(field: "id")): Product @lookup
5858
}
5959
60-
type Person {
60+
type Product {
6161
id: ID!
6262
name: String
6363
}
@@ -77,18 +77,18 @@ public static TheoryData<string[], string[]> InvalidExamplesData()
7777
[
7878
"""
7979
type Query {
80-
personById(id: ID! @is(field: "{ id ")): Person @lookup
80+
product(id: ID! @is(field: "{ id ")): Product @lookup
8181
}
8282
83-
type Person {
83+
type Product {
8484
id: ID!
8585
name: String
8686
}
8787
"""
8888
],
8989
[
90-
"The @is directive on argument 'Query.personById(id:)' in schema 'A' "
91-
+ "contains invalid syntax in the 'field' argument."
90+
"The @is directive on argument 'Query.product(id:)' in schema 'A' contains "
91+
+ "invalid syntax in the 'field' argument."
9292
]
9393
}
9494
};

0 commit comments

Comments
 (0)