resettable schemas, getCurrentSchemaName for TypeResolver, and IsPublic support for InputObject fields#1241
Open
vlydev wants to merge 6 commits intooverblog:masterfrom
Open
resettable schemas, getCurrentSchemaName for TypeResolver, and IsPublic support for InputObject fields#1241vlydev wants to merge 6 commits intooverblog:masterfrom
vlydev wants to merge 6 commits intooverblog:masterfrom
Conversation
fix: resettable schemas fix: resettable schemas
…ublic InputObject support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds three independent improvements to the bundle, primarily motivated by long-running process compatibility (e.g. RoadRunner, Swoole, FrankenPHP) and better ACL
control over input types.
What changed:
factories
In long-running process environments (RoadRunner, Swoole, ReactPHP), the Symfony kernel's reset() cycle is called between requests. Previously, built schemas were cached via a
static variable inside the getBuilder() closure, which meant they survived resets entirely — causing stale type registries and memory growth over time.
This change moves schema caching into SchemaBuilder::$builders (an instance property), so reset() can selectively evict schemas marked as resettable: true. Non-resettable
schemas (the default) are kept across resets for performance. The same principle applies to AbstractResolver: factories are registered once at boot and survive resets, while
resolved instances are cleared so they can be rebuilt fresh on the next request.
What changed:
The current schema name is set internally during schema build but was previously inaccessible from outside the resolver. Services and extensions that need to apply
schema-specific logic (e.g. different ACL rules per schema, custom type loaders, multi-schema middleware) had no way to read which schema is currently being resolved without
injecting additional state. This getter exposes what was already tracked internally, with zero behavioral change.
What changed:
#[IsPublic] was already supported on ObjectType fields and at the provider level, but InputObject fields had no equivalent. This gap meant that input fields carrying sensitive
data (e.g. an adminNotes field on a search input) could not be conditionally hidden via expression language — the only option was to create separate input types. This change
brings InputObject field visibility in line with ObjectType field visibility, using the same expression-language mechanism already present in the bundle.