File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -285,6 +285,7 @@ protected function extendInputObjectType(InputObjectType $type): InputObjectType
285
285
'parseValue ' => [$ type , 'parseValue ' ],
286
286
'astNode ' => $ type ->astNode ,
287
287
'extensionASTNodes ' => $ extensionASTNodes ,
288
+ 'isOneOf ' => $ type ->isOneOf ,
288
289
]);
289
290
}
290
291
Original file line number Diff line number Diff line change @@ -1234,6 +1234,38 @@ interface NewInterface {
1234
1234
);
1235
1235
}
1236
1236
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
+
1237
1269
/** @see it('allows extension of interface with missing Object fields') */
1238
1270
public function testAllowsExtensionOfInterfaceWithMissingObjectFields (): void
1239
1271
{
You can’t perform that action at this time.
0 commit comments