diff --git a/Command/GraphQLDumpSchemaCommand.php b/Command/GraphQLDumpSchemaCommand.php index 75c628706..9bb40d7fe 100644 --- a/Command/GraphQLDumpSchemaCommand.php +++ b/Command/GraphQLDumpSchemaCommand.php @@ -12,25 +12,20 @@ use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\DependencyInjection\ContainerInterface; -class GraphQLDumpSchemaCommand extends Command +final class GraphQLDumpSchemaCommand extends Command { /** @var ContainerInterface */ private $container; - /** @var string */ - private $relayVersion; - /** @var string */ private $baseExportPath; public function __construct( ContainerInterface $container, - $relayVersion, $baseExportPath ) { parent::__construct(); $this->container = $container; - $this->relayVersion = $relayVersion; $this->baseExportPath = $baseExportPath; } @@ -126,12 +121,7 @@ private function useModernJsonFormat(InputInterface $input) throw new \InvalidArgumentException('"modern" and "classic" options should not be used together.'); } - // none chosen so fallback on default behavior - if (!$modern && !$classic) { - return 'modern' === $this->relayVersion; - } - - return $modern; + return true === $modern; } /** diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 1da92136f..4cb70f409 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -177,12 +177,6 @@ public function getConfigTreeBuilder() ->booleanNode('handle_cors')->defaultFalse()->end() ->end() ->end() - ->arrayNode('versions') - ->addDefaultsIfNotSet() - ->children() - ->enumNode('relay')->values(['modern', 'classic'])->defaultValue('classic')->end() - ->end() - ->end() ->end(); return $treeBuilder; diff --git a/DependencyInjection/OverblogGraphQLExtension.php b/DependencyInjection/OverblogGraphQLExtension.php index fcc4c9e76..5704573ba 100644 --- a/DependencyInjection/OverblogGraphQLExtension.php +++ b/DependencyInjection/OverblogGraphQLExtension.php @@ -35,7 +35,6 @@ public function load(array $configs, ContainerBuilder $container) $this->setErrorHandlerArguments($config, $container); $this->setSecurity($config, $container); $this->setConfigBuilders($config, $container); - $this->setVersions($config, $container); $this->setShowDebug($config, $container); $this->setDefinitionParameters($config, $container); $this->setClassLoaderListener($config, $container); @@ -123,13 +122,6 @@ private function setShowDebug(array $config, ContainerBuilder $container) $container->getDefinition($this->getAlias().'.request_executor')->replaceArgument(4, $config['definitions']['show_debug_info']); } - private function setVersions(array $config, ContainerBuilder $container) - { - foreach ($config['versions'] as $key => $version) { - $container->setParameter(sprintf('%s.versions.%s', $this->getAlias(), $key), $version); - } - } - private function setConfigBuilders(array $config, ContainerBuilder $container) { $useObjectToAddResource = method_exists($container, 'addObjectResource'); diff --git a/Resources/config/services.yml b/Resources/config/services.yml index ae70602a8..b0d6a640d 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -138,7 +138,6 @@ services: # is instanced before ClassLoaderEvent. This issues is fix in Symfony 3.4 introducing lazy commands # see https://symfony.com/blog/new-in-symfony-3-4-lazy-commands - '@service_container' - - "%overblog_graphql.versions.relay%" - "%kernel.root_dir%" tags: - { name: console.command } diff --git a/UPGRADE-0.11.md b/UPGRADE-0.11.md index 3b8a4c835..fbeccf796 100644 --- a/UPGRADE-0.11.md +++ b/UPGRADE-0.11.md @@ -16,3 +16,27 @@ UPGRADE FROM 0.10 to 0.11 - Installing OverblogGraphiQLBundle - `composer require --dev overblog/graphiql-bundle` - Follow instructions at https://github.com/overblog/GraphiQLBundle + - In case you have defined the `versions` in your configuration + - Remove it from `overblog_graphql` + ```diff + overblog_graphql: + - versions: + - graphiql: "0.11" + - react: "15.6" + - fetch: "2.0" + - relay: "classic" + ``` + - Add it to `overblog_graphiql` + ```diff + overblog_graphiql: + + javascript_libraries: + + graphiql: "0.11" + + react: "15.6" + + fetch: "2.0" + ``` + - If you were using the `graphql:dump-schema` and depending on the `relay` + version as in the previous configuration, now you have to explicitly choose + for a format during the command: + ``` + bin/console graphql:dump-schema --modern + ```