Skip to content

Commit 9b50d7a

Browse files
committed
test: Add test that reproduce issue #1165
1 parent 501193b commit 9b50d7a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

tests/Config/Parser/MetadataParserTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,9 @@ public function testArgsAndReturnGuessing(): void
459459
'planet' => ['type' => 'PlanetInput', 'defaultValue' => null],
460460
'away' => ['type' => 'Boolean', 'defaultValue' => false],
461461
'maxDistance' => ['type' => 'Float', 'defaultValue' => null],
462+
'cases' => ['type' => '[String!]!'],
462463
],
463-
'resolve' => '@=call(value.getCasualties, arguments({raceId: "String!", areaId: "Int!", dayStart: "Int", dayEnd: "Int", nameStartingWith: "String", planet: "PlanetInput", away: "Boolean", maxDistance: "Float"}, args))',
464+
'resolve' => '@=call(value.getCasualties, arguments({raceId: "String!", cases: "[String!]!", areaId: "Int!", dayStart: "Int", dayEnd: "Int", nameStartingWith: "String", planet: "PlanetInput", away: "Boolean", maxDistance: "Float"}, args))',
464465
'complexity' => '@=childrenComplexity * 5',
465466
],
466467
],

tests/Config/Parser/fixtures/annotations/Type/Battle.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ final class Battle
2323
* @GQL\Field(name="casualties", complexity="childrenComplexity * 5")
2424
*
2525
* @GQL\Arg(name="raceId", type="String!", description="A race ID")
26+
* @GQL\Arg(name="cases", type="[String!]!")
2627
*/
2728
#[GQL\Field(name: 'casualties', complexity: 'childrenComplexity * 5')]
2829
#[GQL\Arg(name: 'raceId', type: 'String!', description: 'A race ID')]
30+
#[GQL\Arg(name: 'cases', type: '[String!]!')]
2931
public function getCasualties(
3032
int $areaId,
3133
?string $raceId,
@@ -34,7 +36,8 @@ public function getCasualties(
3436
string $nameStartingWith = '',
3537
Planet $planet = null,
3638
bool $away = false,
37-
float $maxDistance = null
39+
float $maxDistance = null,
40+
array $cases = []
3841
): ?int {
3942
return 12;
4043
}

0 commit comments

Comments
 (0)