Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tests/Config/Parser/MetadataParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -459,8 +459,9 @@ public function testArgsAndReturnGuessing(): void
'planet' => ['type' => 'PlanetInput', 'defaultValue' => null],
'away' => ['type' => 'Boolean', 'defaultValue' => false],
'maxDistance' => ['type' => 'Float', 'defaultValue' => null],
'cases' => ['type' => '[String!]!'],
],
'resolve' => '@=call(value.getCasualties, arguments({raceId: "String!", areaId: "Int!", dayStart: "Int", dayEnd: "Int", nameStartingWith: "String", planet: "PlanetInput", away: "Boolean", maxDistance: "Float"}, args))',
'resolve' => '@=call(value.getCasualties, arguments({raceId: "String!", cases: "[String!]!", areaId: "Int!", dayStart: "Int", dayEnd: "Int", nameStartingWith: "String", planet: "PlanetInput", away: "Boolean", maxDistance: "Float"}, args))',
'complexity' => '@=childrenComplexity * 5',
],
],
Expand Down
5 changes: 4 additions & 1 deletion tests/Config/Parser/fixtures/annotations/Type/Battle.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ final class Battle
* @GQL\Field(name="casualties", complexity="childrenComplexity * 5")
*
* @GQL\Arg(name="raceId", type="String!", description="A race ID")
* @GQL\Arg(name="cases", type="[String!]!")
*/
#[GQL\Field(name: 'casualties', complexity: 'childrenComplexity * 5')]
#[GQL\Arg(name: 'raceId', type: 'String!', description: 'A race ID')]
#[GQL\Arg(name: 'cases', type: '[String!]!')]
public function getCasualties(
int $areaId,
?string $raceId,
Expand All @@ -34,7 +36,8 @@ public function getCasualties(
string $nameStartingWith = '',
Planet $planet = null,
bool $away = false,
float $maxDistance = null
float $maxDistance = null,
array $cases = []
): ?int {
return 12;
}
Expand Down