Skip to content

Transfer config in schema extender#1672

Draft
Warxcell wants to merge 6 commits into
webonyx:masterfrom
Warxcell:transfer_config_schema_extender
Draft

Transfer config in schema extender#1672
Warxcell wants to merge 6 commits into
webonyx:masterfrom
Warxcell:transfer_config_schema_extender

Conversation

@Warxcell

Copy link
Copy Markdown
Contributor

Fixes #1671

@Warxcell Warxcell changed the title Transfer config schema extender Transfer config in schema extender Feb 17, 2025
@spawnia

spawnia commented Feb 19, 2025

Copy link
Copy Markdown
Collaborator

I just applied the codestyle fixes through #1674, please merge the latest master before I review.

@spawnia
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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::$config entries 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

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 */
= '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: ability to attach custom attributes to field definitions.

3 participants