DependencyInjection/Compiler/GraphQlCompilerPass.php
private function addListVoter(ContainerBuilder $container, $voterClass, array $list)
    {
        if ($list) {
            $container
                ->getDefinition('graphql.security.voter')
                ->setClass($voterClass)
                ->addMethodCall('setEnabled', [true])
                ->addMethodCall('setList', [$list]);

            $container->setParameter('graphql.security.guard_config', [
                'operation' => true,
                'field'     => false,
            ]);
        }
    }
private function addListVoter(ContainerBuilder $container, $voterClass, array $list)
    {
        if ($list) {
            $container
                ->getDefinition('graphql.security.voter')
                ->setClass($voterClass)
                ->addMethodCall('setEnabled', [true])
                ->addMethodCall('setList', [$list]);

            $container->setParameter('graphql.security.guard_config', [
                'operation' => true,
                'field'     => false,
            ]);
        }
    }
@param ContainerBuilder $container
@param                  $voterClass
@param array            $list

@throws \Exception