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