• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Warning: This build has drifted.
The coverage report for this pull request build may be inaccurate because its base commit is no longer the HEAD of its target branch.
This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

    • Learn more: For more information on this, see Tracking coverage changes for pull request builds.
    • Fix now: For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
    • Prevent going forward: To avoid this issue with future PRs, see these Recommended CI Configurations.
New Repo Setting:
INCLUDE COVERAGE % WITH WARNINGS ABOUT DRIFTED BUILDS?

Enabling this setting will include a (potentially inaccurate) coverage % with warning messages in status updates for drifted builds.

Adjust setting

99designs / gqlgen / 34460702573
0%
master: 0%

Build:
Build:
LAST BUILD BRANCH: fix/lazy-scalar-fieldcontext-error
DEFAULT BRANCH: master
Ran 10 Sep 2026 10:53AM UTC
Jobs 1
Files 0
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

10 Sep 2026 09:26AM UTC coverage: 0.0%. First build
34460702573

Pull #4293

github

Yuyang Guo
perf: build the "no child fields" error lazily, without a global var

@StevenACoffman objected to the shared-global-error approach from the
previous commit: gqlgen is actively moving away from package-level
mutable state (RULES.md #9), and generated code/templates should stay
simple. @korotin proposed a compromise: keep NewScalarFieldContext's
fast path, but pass the scalar/enum type name instead of a pre-built
error, and build the error lazily inside the Child closure only when a
client illegally selects sub-fields on a scalar (essentially never for
a well-formed query).

This changes NewScalarFieldContext's exported signature (5th param:
error -> string), which is a real compatibility break for anyone
calling it directly, but there is no evidence of hand-written external
callers. Per RULES.md this needs a proposal issue + targeting `next`;
issue #4294 (filed for the prior approach) needs a follow-up edit to
describe this direction instead.

Benchmarked all three variants on _examples/todo's fieldContext_Todo_id
to confirm this doesn't regress vs. the (now reverted) shared-global-
error approach:

    master (pre-#4293):                 184 B/op   3 allocs/op
    shared-global-error (prior commit): 168 B/op   2 allocs/op
    this commit (typeName):             168 B/op   2 allocs/op

Allocation count ties with the reverted approach -- the Child closure
still captures a call-varying parameter (childErr there, typeName
here) and escapes with the returned *FieldContext either way, so
building the error lazily doesn't remove an allocation. The win here
is entirely about not needing a global var or any new codegen data
plumbing: Data.UniqueScalarChildFieldErrors and the errChildFields_*
var block are gone, and the generated call site stays a single line
per field, matching #4086's original intent.

Also regenerates _examples/uuid and
plugin/federation/testdata/keycollision, which aren't wired into any
go:generate sweep and would otherwise fail to build ag... (continued)
Pull Request #4293: perf: share the "no child fields" error across all fields of a scalar/enum type

0 of 0 relevant lines covered (NaN%)

0.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 34460702573.1 10 Sep 2026 10:53AM UTC 0
0.0
GitHub Action Run
Source Files on build 34460702573
Detailed source file information is not available for this build.
  • Back to Repo
  • Pull Request #4293
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc