Skip to content

Commit 51e3a81

Browse files
yaacovCRphryneas
andauthored
validation: add description-handling comment (#4587)
from #4517 on 16.x.x Co-authored-by: Lenz Weber-Tronic <mail@lenzw.de>
1 parent 7ee03c1 commit 51e3a81

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/validation/rules/ValuesOfCorrectTypeRule.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ export function ValuesOfCorrectTypeRule(
3434
IntValue: (node) => isValidValueNode(context, node, context.getInputType()),
3535
FloatValue: (node) =>
3636
isValidValueNode(context, node, context.getInputType()),
37+
// Descriptions are string values that would not validate according
38+
// to the below logic, but since (per the specification) descriptions must
39+
// not affect validation, they are ignored entirely when visiting the AST
40+
// and do not require special handling.
41+
// See https://spec.graphql.org/draft/#sec-Descriptions
3742
StringValue: (node) =>
3843
isValidValueNode(context, node, context.getInputType()),
3944
BooleanValue: (node) =>

0 commit comments

Comments
 (0)