use Overblog\GraphQLBundle\Definition\Builder\MappingInterface;
8
9
class RelayConnectionFieldsBuilder implements MappingInterface
10
{
11
3
public function toMappingDefinition(array $config): array
12
{
13
3
if (!isset($config['edgeType']) || !\is_string($config['edgeType'])) {
14
2
throw new \InvalidArgumentException('Using the Relay Connection fields builder, the key "edgeType" defining the GraphQL type of edges is required and must be a string.');
15
}
16
17
1
$edgeType = $config['edgeType'];
18
1
$edgeDescription = $config['edgeDescription'] ?? 'Edges of the connection';