File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -285,6 +285,7 @@ protected function extendInputObjectType(InputObjectType $type): InputObjectType
285285 'parseValue ' => [$ type , 'parseValue ' ],
286286 'astNode ' => $ type ->astNode ,
287287 'extensionASTNodes ' => $ extensionASTNodes ,
288+ 'isOneOf ' => $ type ->isOneOf ,
288289 ]);
289290 }
290291
Original file line number Diff line number Diff line change @@ -1234,6 +1234,38 @@ interface NewInterface {
12341234 );
12351235 }
12361236
1237+ /** @see it('extends input but keeps isOneOf') */
1238+ public function testExtendsInputObjectsAndKeepsIsOneOf (): void
1239+ {
1240+ $ schema = BuildSchema::build ('
1241+ input Foo @oneOf {
1242+ barA: String
1243+ barB: String
1244+ }
1245+ type Query {
1246+ someQuery(args: Foo!): Boolean
1247+ }
1248+ ' );
1249+ $ extendAST = Parser::parse ('
1250+ extend input Foo {
1251+ barC: String
1252+ }
1253+ ' );
1254+ $ extendedSchema = SchemaExtender::extend ($ schema , $ extendAST );
1255+
1256+ self ::assertEmpty ($ extendedSchema ->validate ());
1257+ self ::assertSame (
1258+ <<<GRAPHQL
1259+ input Foo @oneOf {
1260+ barA: String
1261+ barB: String
1262+ barC: String
1263+ }
1264+ GRAPHQL ,
1265+ self ::printSchemaChanges ($ schema , $ extendedSchema )
1266+ );
1267+ }
1268+
12371269 /** @see it('allows extension of interface with missing Object fields') */
12381270 public function testAllowsExtensionOfInterfaceWithMissingObjectFields (): void
12391271 {
You can’t perform that action at this time.
0 commit comments