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

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

Build:
Build:
LAST BUILD BRANCH: dependabot/go_modules/github.com/mattn/go-colorable-0.1.15
DEFAULT BRANCH: master
Ran 29 Apr 2026 09:39PM 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

29 Apr 2026 09:34PM UTC coverage: 0.0%. Remained the same
25135151727

Pull #4138

github

lbarthon
graphql: add runtime non-null field support via MarkNonNull

In GraphQL, null propagation (nulling out a parent object when a child
field resolves to nil) only applies to fields declared as non-null (!)
in the schema. This is a compile-time property baked into the generated
code — there was no way for middleware to trigger it dynamically.

This is needed for use cases like a @priority(value: Required) directive
where the client marks certain fields as semantically required in the
query. These fields are nullable in the schema, but when they fail at
runtime, the response should behave as if they were non-null: the error
propagates up and the nearest nullable ancestor is set to null.

Changes:

- Add FieldContext.NonNull flag and graphql.MarkNonNull(ctx) API.
  A FieldInterceptor calls MarkNonNull during resolution to opt a
  nullable field into non-null semantics for that request.

- Add graphql.RequiredNull sentinel. It marshals to "null" like
  graphql.Null but is a distinct pointer. resolveField returns it
  (instead of Null) when a dynamically-marked field fails, so the
  parent's generated code can distinguish the two cases.

- Update resolveField to check fc.NonNull alongside the static nonNull
  parameter. On nil/error, it emits the standard "must not be null"
  error and returns RequiredNull.

- Update object.gotpl so nullable fields check for RequiredNull and
  increment Invalids, triggering the same null propagation cascade as
  a schema-level non-null violation. Concurrent field closures now
  always receive the FieldSet parameter (previously ignored for
  nullable fields).

Existing behavior is fully preserved: statically non-null fields still
return Null and are caught by the existing res == graphql.Null check.
RequiredNull is never returned unless a FieldInterceptor explicitly
opts in via MarkNonNull.
Pull Request #4138: graphql: add runtime non-null field support via MarkNonNull

0 of 0 relevant lines covered (NaN%)

0.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 25135151727.1 29 Apr 2026 09:39PM UTC 0
0.0
GitHub Action Run
Source Files on build 25135151727
Detailed source file information is not available for this build.
  • Back to Repo
  • Pull Request #4138
  • PR Base - master (#25008413119)
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