Skip to content

Remove incorrect @Nullable from GraphQLSchema.getCodeRegistry()#4247

Merged
andimarek merged 1 commit intomasterfrom
schema-codregistry-nullable
Feb 15, 2026
Merged

Remove incorrect @Nullable from GraphQLSchema.getCodeRegistry()#4247
andimarek merged 1 commit intomasterfrom
schema-codregistry-nullable

Conversation

@andimarek
Copy link
Member

Summary

  • Remove @Nullable annotation from GraphQLSchema.codeRegistry field and getCodeRegistry() return type
  • Fix first-pass constructor to use builder.codeRegistry instead of discarding it and setting the field to null

Why

The field was annotated @Nullable and the first-pass constructor (private GraphQLSchema(Builder)) set this.codeRegistry = null — despite asserting builder.codeRegistry was non-null on the line above. All three constructors require a non-null codeRegistry, and no fully-constructed schema ever exposes a null value.

The @Nullable annotation was misleading and caused downstream code to add unnecessary null checks (e.g. schema.getCodeRegistry() != null guards in validation).

Test plan

  • Full test suite passes

🤖 Generated with Claude Code

The codeRegistry field was annotated @nullable and the first-pass
constructor set it to null, even though it asserted the builder value
was non-null. All three constructors require a non-null codeRegistry,
and no fully-constructed schema ever has a null codeRegistry.

Fix the first-pass constructor to use the builder's codeRegistry
instead of discarding it, and remove @nullable from the field and
getter.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@andimarek andimarek merged commit bd87652 into master Feb 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments