• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

graphql-go / graphql / 1967
87%
master: 96%

Build:
Build:
LAST BUILD BRANCH: type-definitions
DEFAULT BRANCH: master
Ran 14 Jun 2026 05:22PM UTC
Jobs 1
Files 31
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 Jun 2026 04:40PM UTC coverage: 87.053% (+0.006%) from 87.047%
1967

Pull #747

circleci

Patrik Hermansson
plan: plan abstract-field selections lazily to avoid exponential blow-up

PlanQuery eagerly expanded every possible type of every Interface/Union
field at plan time (planMergedFieldChildren looped schema.PossibleTypes
and planned each). Because an expanded type's sub-selection can contain
further abstract fields, this compounds to O(possibleTypes ^ nesting
depth): a deeply-nested polymorphic query on a large schema (~100+
implementers) takes minutes to plan and never returns — even when the
request resolves to an empty result, since planning is data-independent.

This already contradicted the documented design ("abstract returns
lazily plan per-concrete-type at execute time, cached on
abstractAlternatives"). Make it actually lazy: planMergedFieldChildren
leaves abstract alternatives unplanned, and completePlannedAbstractValue
plans (and caches) the concrete type's sub-selection the first time that
type is encountered at runtime, guarded by a mutex since fields resolve
concurrently. Object returns are still planned eagerly (single type, no
fan-out).

Plan time for abstract fields is now proportional to the types a request
actually resolves rather than schema_size ^ depth. Object/leaf planning
and execution results are unchanged.

Adds plan_blowup_test.go: a regression guard (deeply-nested abstract
selection must plan within a deadline), a correctness test, and a
benchmark. Without the fix the guard does ~16^12 units of work and times
out; with it, PlanQuery is ~constant-time (6 allocs/op) regardless of
depth.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pull Request #747: new plan abstract-field selections lazily to avoid exponential blow-up

23 of 23 new or added lines in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

8492 of 9755 relevant lines covered (87.05%)

1298.61 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
90.97
0.06% plan.go
Jobs
ID Job ID Ran Files Coverage
1 1967.1 14 Jun 2026 05:22PM UTC 31
87.05
CircleCI Job
Source Files on build 1967
  • Tree
  • List 31
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • CircleCI Build #1967
  • Pull Request #747
  • PR Base - master (#1954)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc