You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,9 @@
3
3
[Unreleased]
4
4
5
5
*[BUGFIX] Reject object, interface, and input object type definitions that declare zero fields/input values (spec compliance).
6
+
*[IMPROVEMENT] Optimize overlapping field validation to avoid quadratic memory blowups on large sibling field lists.
7
+
*[FEATURE] Add configurable safety valve for overlapping field comparison count with `OverlapValidationLimit(n)` schema option (0 disables the cap). When exceeded validation aborts early with rule `OverlapValidationLimitExceeded`. Disabled by default.
8
+
*[TEST] Add benchmarks & randomized overlap stress test for mixed field/fragment patterns.
-`PanicHandler(panicHandler errors.PanicHandler)` is used to transform panics into errors during query execution. It defaults to `errors.DefaultPanicHandler`.
-`DisableFieldSelections()` disables capturing child field selections used by helper APIs (see below).
156
+
-`OverlapValidationLimit(n int)` sets a hard cap on examined overlap pairs during validation; exceeding it emits `OverlapValidationLimitExceeded` error.
// determine a representative location for error reporting
610
+
varloc errors.Location
611
+
switchsel:=a.(type) {
612
+
case*ast.Field:
613
+
loc=sel.Alias.Loc
614
+
case*ast.InlineFragment:
615
+
loc=sel.Loc
616
+
case*ast.FragmentSpread:
617
+
loc=sel.Loc
618
+
default:
619
+
// leave zero value
620
+
}
621
+
c.addErr(loc, "OverlapValidationLimitExceeded", "Overlapping field validation aborted after examining %d pairs (limit %d). Consider restructuring the query or increasing the limit.", c.overlapPairsObserved-1, c.overlapPairLimit)
0 commit comments