Transfer config in schema extender#1672
Draft
Warxcell wants to merge 6 commits into
Draft
Conversation
Collaborator
|
I just applied the codestyle fixes through #1674, please merge the latest |
spawnia
marked this pull request as draft
February 19, 2025 15:57
# Conflicts: # src/Language/Lexer.php # src/Utils/BuildClientSchema.php # src/Utils/BuildSchema.php # src/Validator/Rules/QueryComplexity.php
Contributor
There was a problem hiding this comment.
Pull request overview
Ensures custom field configuration added during schema building (e.g., via fieldConfigDecorator) is preserved when a schema is extended via SchemaExtender, enabling consumers (like custom executors) to read custom field attributes after extension.
Changes:
- Preserve existing
FieldDefinition::$configentries when rebuilding field configs during schema extension. - Add a regression test verifying custom field config keys are retained for existing fields and applied to newly-added extension fields.
- Minor formatting adjustments in tests around
/** @lang GraphQL */inline annotations.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/Utils/SchemaExtender.php |
Preserves original field config by merging (...$field->config) into the reconstructed field config during extension. |
tests/Utils/SchemaExtenderTest.php |
Adds coverage asserting custom field config keys survive schema extension and apply to extension-introduced fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1737
to
+1738
| $query /** @lang GraphQL */ | ||
| = '{ hello }'; |
Comment on lines
+1774
to
+1775
| $query /** @lang GraphQL */ | ||
| = '{ hello }'; |
Comment on lines
+1783
to
+1784
| $sdl /** @lang GraphQL */ | ||
| = ' |
Comment on lines
+1797
to
+1798
| $extensionSdl /** @lang GraphQL */ | ||
| = ' |
Comment on lines
+1929
to
+1930
| $query /** @lang GraphQL */ | ||
| = ' |
Comment on lines
+2038
to
+2039
| $query /** @lang GraphQL */ | ||
| = ' |
Comment on lines
+2097
to
+2098
| $query /** @lang GraphQL */ | ||
| = ' |
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.
Fixes #1671