From 8f81f4b848c1a7372409409f56ab3396f7ada0e0 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Thu, 9 Jul 2026 11:09:19 +0300 Subject: [PATCH 1/2] fix(utils): preserve deprecated input values in client schema --- src/Utils/BuildClientSchema.php | 1 + tests/Utils/BuildClientSchemaTest.php | 28 +++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Utils/BuildClientSchema.php b/src/Utils/BuildClientSchema.php index 33276c04b..13d157868 100644 --- a/src/Utils/BuildClientSchema.php +++ b/src/Utils/BuildClientSchema.php @@ -522,6 +522,7 @@ public function buildInputValue(array $inputValueIntrospection): array $inputValue = [ 'description' => $inputValueIntrospection['description'], + 'deprecationReason' => $inputValueIntrospection['deprecationReason'] ?? null, 'type' => $type, ]; diff --git a/tests/Utils/BuildClientSchemaTest.php b/tests/Utils/BuildClientSchemaTest.php index 8d7e17599..9f990f1b6 100644 --- a/tests/Utils/BuildClientSchemaTest.php +++ b/tests/Utils/BuildClientSchemaTest.php @@ -521,18 +521,42 @@ enum Color { """So sickening""" MAUVE @deprecated(reason: "No longer in fashion") } - + + input ColorInput { + oldColor: String @deprecated(reason: "Use color") + color: String + } + type Query { """This is a shiny string field""" shinyString: String - + """This is a deprecated string field""" deprecatedString: String @deprecated(reason: "Use shinyString") + paint(oldColor: String @deprecated(reason: "Use color"), color: String, input: ColorInput): Color color: Color } '); } + /** it('prints deprecated input values from a client schema', () => {. */ + public function testPrintsDeprecatedInputValuesFromClientSchema(): void + { + $sdl = << {. */ public function testBuildsASchemaWithEmptyDeprecationReasons(): void { From 2e1f1f6000d4352f5b694d34d89a8321ed68c137 Mon Sep 17 00:00:00 2001 From: Simon Podlipsky Date: Thu, 9 Jul 2026 12:43:47 +0300 Subject: [PATCH 2/2] test(utils): avoid redundant client schema print coverage --- tests/Utils/BuildClientSchemaTest.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/tests/Utils/BuildClientSchemaTest.php b/tests/Utils/BuildClientSchemaTest.php index 9f990f1b6..677062481 100644 --- a/tests/Utils/BuildClientSchemaTest.php +++ b/tests/Utils/BuildClientSchemaTest.php @@ -539,24 +539,6 @@ enum Color { '); } - /** it('prints deprecated input values from a client schema', () => {. */ - public function testPrintsDeprecatedInputValuesFromClientSchema(): void - { - $sdl = << {. */ public function testBuildsASchemaWithEmptyDeprecationReasons(): void {