From 37537f0abbd6f0653df15c0db7510934b15a12cc Mon Sep 17 00:00:00 2001 From: "dev.aleksey.ch" Date: Sun, 11 Feb 2024 15:07:06 +0200 Subject: [PATCH 1/3] fix bugs --- DependencyInjection/Configuration.php | 4 ++-- composer.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index f8876d6..57c6917 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -18,8 +18,8 @@ class Configuration implements ConfigurationInterface */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); - $rootNode = $treeBuilder->root('graphql'); + $treeBuilder = new TreeBuilder('graphql'); + $rootNode = $treeBuilder->getRootNode(); $rootNode ->children() diff --git a/composer.json b/composer.json index acf3f24..7440ebf 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "youshido/graphql-bundle", + "name": "ozznest/base-graphql-bundle", "description": "Symfony GraphQl Bundle", "license": "MIT", "authors": [ From 99c95fd3b6407fdf3edc144550251b14e9f5f363 Mon Sep 17 00:00:00 2001 From: "dev.aleksey.ch" Date: Sun, 11 Feb 2024 15:43:40 +0200 Subject: [PATCH 2/3] change controller for sf 5 --- Controller/GraphQLController.php | 4 ++-- Controller/GraphQLExplorerController.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Controller/GraphQLController.php b/Controller/GraphQLController.php index d8f7cf1..dd40d95 100644 --- a/Controller/GraphQLController.php +++ b/Controller/GraphQLController.php @@ -7,7 +7,7 @@ namespace Youshido\GraphQLBundle\Controller; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\Routing\Annotation\Route; @@ -15,7 +15,7 @@ use Youshido\GraphQLBundle\Exception\UnableToInitializeSchemaServiceException; use Youshido\GraphQLBundle\Execution\Processor; -class GraphQLController extends Controller +class GraphQLController extends AbstractController { /** * @Route("/graphql") diff --git a/Controller/GraphQLExplorerController.php b/Controller/GraphQLExplorerController.php index 4b48736..4dc5e83 100644 --- a/Controller/GraphQLExplorerController.php +++ b/Controller/GraphQLExplorerController.php @@ -9,9 +9,9 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; -use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -class GraphQLExplorerController extends Controller +class GraphQLExplorerController extends AbstractController { /** * @Route("/graphql/explorer") From c7f0de8e2353e1455f4663da85f91b38a6c9ef56 Mon Sep 17 00:00:00 2001 From: "dev.aleksey.ch" Date: Sun, 11 Feb 2024 15:57:09 +0200 Subject: [PATCH 3/3] change controller for sf 5 --- Command/GraphQLConfigureCommand.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Command/GraphQLConfigureCommand.php b/Command/GraphQLConfigureCommand.php index ee6c492..adfbd18 100644 --- a/Command/GraphQLConfigureCommand.php +++ b/Command/GraphQLConfigureCommand.php @@ -8,11 +8,21 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Question\ConfirmationQuestion; +use Symfony\Component\Console\Command\Command; +use Symfony\Component\DependencyInjection\ContainerInterface; -class GraphQLConfigureCommand extends ContainerAwareCommand +class GraphQLConfigureCommand extends Command { const PROJECT_NAMESPACE = 'App'; + private ContainerInterface $container; + + public function __construct(ContainerInterface $container) + { + parent::__construct(); + $this->container = $container; + } + /** * {@inheritdoc} */ @@ -31,8 +41,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $isComposerCall = $input->getOption('composer'); - $container = $this->getContainer(); - $rootDir = $container->getParameter('kernel.root_dir'); + $rootDir = $this->container->getParameter('kernel.root_dir'); $configFile = $rootDir . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'config/packages/graphql.yml'; $className = 'Schema';