Skip to content

Commit

Permalink
Merge pull request #53 from TomHAnderson/feature/performances
Browse files Browse the repository at this point in the history
Added performances to root graphql
  • Loading branch information
TomHAnderson authored Oct 18, 2024
2 parents c6513b7 + 8ae19c4 commit 6b3d3e4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app/GraphQL/Query/Performance/Connection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace App\GraphQL\Query\Performance;

use ApiSkeletons\Doctrine\ORM\GraphQL\Driver;
use App\Doctrine\ORM\Entity\Performance;
use App\GraphQL\Field;

class Connection implements Field
{
/**
* @param mixed[] $variables
*
* @return mixed[]
*/
public static function getDefinition(
Driver $driver,
array $variables = [],
string|null $operationName = null,
): array {
return $driver->completeConnection(Performance::class);
}
}
1 change: 1 addition & 0 deletions app/Http/Controllers/GraphQLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function __invoke(EntityManager $entityManager, Request $request): array
'fields' => [
'artist' => Query\Artist\Entity::getDefinition($driver, $variables, $operationName),
'artists' => Query\Artist\Connection::getDefinition($driver, $variables, $operationName),
'performances' => Query\Performance\Connection::getDefinition($driver, $variables, $operationName),
],
]),
'mutation' => new ObjectType([
Expand Down

0 comments on commit 6b3d3e4

Please sign in to comment.