From e3fd8973b4a6029e517b045eab8c7e44af352d2b Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Thu, 21 Sep 2017 17:37:58 +0200 Subject: [PATCH 1/6] Add contribution documentation --- CONTRIBUTING.md | 20 ++++++++++++++++++++ README.md | 22 ++++------------------ 2 files changed, 24 insertions(+), 18 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..56292551f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,20 @@ +Contributing +============ + +Running tests +-------------- + +Install [phpunit](https://phpunit.de/manual/current/en/installation.html). + +In the bundle directory: + +```bash +bin/phpunit +``` + +Giving some love to PHP CS +--------------------------- + +```bash +bin/php-cs-fixer fix ./ +``` diff --git a/README.md b/README.md index fe4d26433..e48947160 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ OverblogGraphQLBundle This Symfony 2 / 3 bundle provide integration [GraphQL](https://facebook.github.io/graphql/) using [webonyx/graphql-php](https://github.com/webonyx/graphql-php) and [GraphQL Relay](https://facebook.github.io/relay/docs/graphql-relay-specification.html). -It also supports batching using libs like [ReactRelayNetworkLayer](https://github.com/nodkz/react-relay-network-layer). +It also supports batching using libs like [ReactRelayNetworkLayer](https://github.com/nodkz/react-relay-network-layer) or [Apollo GraphQL](http://dev.apollodata.com/core/network.html#query-batching). [![Build Status](https://travis-ci.org/overblog/GraphQLBundle.svg?branch=master)](https://travis-ci.org/overblog/GraphQLBundle) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/overblog/GraphQLBundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/overblog/GraphQLBundle/?branch=master) @@ -18,21 +18,7 @@ For documentation, see: [Read the documentation](Resources/doc/index.md) -Contribute ----------- +Contributing +------------ -Tests: - -Install [phpunit](https://phpunit.de/manual/current/en/installation.html). - -In the bundle directory: - -```bash -phpunit -``` - -Fix PHP CS: - -```bash -vendor/bin/php-cs-fixer fix ./ -``` +[See contributing documentation](CONTRIBUTING.md) From c3f4d2724ba2db61c07fdb7028eff179f2db63dd Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Thu, 21 Sep 2017 17:38:41 +0200 Subject: [PATCH 2/6] Refactor travis config file --- .travis.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 61872c814..68bfee4f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ matrix: - php: 7.0 env: SYMFONY_VERSION=3.2.* - php: 7.1 - env: SYMFONY_VERSION=3.3.* SCRUTINIZER=true + env: SYMFONY_VERSION=3.3.* TEST_COVERAGE=true - php: 7.1 env: GRAPHQLPHP_VERSION=0.10.0 - php: hhvm @@ -31,7 +31,7 @@ cache: - $HOME/.php_cs.cache before_install: - - if [[ ${SCRUTINIZER} != true && ${TRAVIS_PHP_VERSION} != "hhvm" ]]; then phpenv config-rm xdebug.ini || true; fi + - if [ ${TEST_COVERAGE} != true ]; then phpenv config-rm xdebug.ini || true; fi - composer selfupdate - if [ $SYMFONY_VERSION ]; then composer require "symfony/symfony:${SYMFONY_VERSION}" "symfony/framework-bundle:${SYMFONY_VERSION}" --dev --no-update; fi; - if [ $GRAPHQLPHP_VERSION ]; then composer require "webonyx/graphql-php:${GRAPHQLPHP_VERSION}" --dev --no-update; fi; @@ -39,9 +39,9 @@ before_install: install: composer update --prefer-source --no-interaction --optimize-autoloader script: - - bin/phpunit --debug $( if [ $SCRUTINIZER = true ]; then echo "-d xdebug.max_nesting_level=1000 --coverage-clover=build/logs/clover.xml"; fi; ) + - bin/phpunit --debug $( if [ $TEST_COVERAGE = true ]; then echo "-d xdebug.max_nesting_level=1000 --coverage-clover=build/logs/clover.xml"; fi; ) - if [ ${TRAVIS_PHP_VERSION} == "7.0" ]; then bin/php-cs-fixer fix --diff --dry-run -v; fi; after_script: - - if [ ${SCRUTINIZER} = true ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi - - if [ ${SCRUTINIZER} = true ]; then composer require "satooshi/php-coveralls:^1.0" && travis_retry php bin/coveralls -v; fi + - if [ ${TEST_COVERAGE} = true ]; then wget https://scrutinizer-ci.com/ocular.phar && travis_retry php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml; fi + - if [ ${TEST_COVERAGE} = true ]; then composer require "satooshi/php-coveralls:^1.0" && travis_retry php bin/coveralls -v; fi From e5ecbcb1ecf6097d7120ad6cda3193436d059678 Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Thu, 21 Sep 2017 17:39:20 +0200 Subject: [PATCH 3/6] Removed unused files --- Resolver/Cache/ArrayCache.php | 36 ------------------------------- Resolver/Cache/CacheInterface.php | 32 --------------------------- 2 files changed, 68 deletions(-) delete mode 100644 Resolver/Cache/ArrayCache.php delete mode 100644 Resolver/Cache/CacheInterface.php diff --git a/Resolver/Cache/ArrayCache.php b/Resolver/Cache/ArrayCache.php deleted file mode 100644 index ca3dc18c4..000000000 --- a/Resolver/Cache/ArrayCache.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Overblog\GraphQLBundle\Resolver\Cache; - -class ArrayCache implements CacheInterface -{ - /** - * @var array - */ - private $cache = []; - - /** - * {@inheritdoc} - */ - public function fetch($key) - { - return isset($this->cache[$key]) ? $this->cache[$key] : null; - } - - /** - * {@inheritdoc} - */ - public function save($key, $result) - { - $this->cache[$key] = $result; - } -} diff --git a/Resolver/Cache/CacheInterface.php b/Resolver/Cache/CacheInterface.php deleted file mode 100644 index db76c5242..000000000 --- a/Resolver/Cache/CacheInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Overblog\GraphQLBundle\Resolver\Cache; - -interface CacheInterface -{ - /** - * Saves a result in the cache. - * - * @param string $key The cache key - * @param mixed $result - */ - public function save($key, $result); - - /** - * Fetches an result from the cache. - * - * @param string $key The cache key - * - * @return mixed|null - */ - public function fetch($key); -} From 9b07cf9da721c6d3a5d7a3190d2a3f4654c3bfa5 Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Thu, 21 Sep 2017 17:44:21 +0200 Subject: [PATCH 4/6] Allow using project composer classLoader also fix default resolver when using php types --- .../Compiler/ConfigTypesPass.php | 11 ++++- DependencyInjection/Configuration.php | 13 +++++- .../OverblogGraphQLExtension.php | 30 ++++++++++++-- Executor/Executor.php | 21 +++++----- Executor/ExecutorInterface.php | 5 +++ Generator/TypeGenerator.php | 20 ++++++---- Request/Executor.php | 13 +++++- Resources/config/services.yml | 17 ++------ Resources/doc/index.md | 40 ++++++++++++++++++- Tests/Functional/App/config/access/config.yml | 5 +-- .../App/config/connection/config.yml | 4 +- .../App/config/connectionWithCORS/config.yml | 5 +-- .../App/config/customScalar/config.yml | 4 +- .../App/config/definition/config.yml | 3 -- .../App/config/exception/config.yml | 4 +- Tests/Functional/App/config/global/config.yml | 4 +- .../Functional/App/config/mutation/config.yml | 4 +- Tests/Functional/App/config/node/config.yml | 4 +- Tests/Functional/App/config/plural/config.yml | 4 +- Tests/Functional/App/config/public/config.yml | 4 +- .../App/config/queryComplexity/config.yml | 4 +- .../App/config/queryComplexityEnv/config.yml | 2 +- .../App/config/queryMaxDepth/config.yml | 4 +- .../App/config/queryMaxDepthEnv/config.yml | 2 +- Tests/Functional/Security/AccessTest.php | 29 ++++++++++++++ 25 files changed, 174 insertions(+), 82 deletions(-) diff --git a/DependencyInjection/Compiler/ConfigTypesPass.php b/DependencyInjection/Compiler/ConfigTypesPass.php index 156d1adf8..a04479cbd 100644 --- a/DependencyInjection/Compiler/ConfigTypesPass.php +++ b/DependencyInjection/Compiler/ConfigTypesPass.php @@ -21,9 +21,18 @@ class ConfigTypesPass implements CompilerPassInterface public function process(ContainerBuilder $container) { $config = $container->getParameter('overblog_graphql_types.config'); - $generatedClasses = $container->get('overblog_graphql.cache_compiler')->compile($this->processConfig($config)); + $generatedClasses = $container->get('overblog_graphql.cache_compiler')->compile( + $this->processConfig($config), + $container->getParameter('overblog_graphql.use_classloader_listener') + ); foreach ($generatedClasses as $class => $file) { + if (!class_exists($class)) { + throw new \RuntimeException(sprintf( + 'Type class %s not found. If you are using your own classLoader verify the path and the namespace please.', + json_encode($class)) + ); + } $aliases = call_user_func($class.'::getAliases'); $this->setTypeServiceDefinition($container, $class, $aliases); } diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index e52745998..04b8d07ea 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -14,6 +14,7 @@ use GraphQL\Validator\Rules\QueryComplexity; use GraphQL\Validator\Rules\QueryDepth; use Overblog\GraphQLBundle\Error\ErrorHandler; +use Overblog\GraphQLBundle\Resolver\Resolver; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -21,14 +22,18 @@ class Configuration implements ConfigurationInterface { private $debug; + private $cacheDir; + /** * Constructor. * - * @param bool $debug Whether to use the debug mode + * @param bool $debug Whether to use the debug mode + * @param null|string $cacheDir */ - public function __construct($debug) + public function __construct($debug, $cacheDir = null) { $this->debug = (bool) $debug; + $this->cacheDir = $cacheDir; } public function getConfigTreeBuilder() @@ -46,6 +51,10 @@ public function getConfigTreeBuilder() ->addDefaultsIfNotSet() ->children() ->scalarNode('internal_error_message')->defaultNull()->end() + ->variableNode('default_resolver')->defaultValue([Resolver::class, 'defaultResolveFn'])->end() + ->scalarNode('class_namespace')->defaultValue('Overblog\\GraphQLBundle\\__DEFINITIONS__')->end() + ->scalarNode('cache_dir')->defaultValue($this->cacheDir.'/overblog/graphql-bundle/__definitions__')->end() + ->booleanNode('use_classloader_listener')->defaultTrue()->end() ->booleanNode('show_debug_info')->defaultFalse()->end() ->booleanNode('config_validation')->defaultValue($this->debug)->end() ->arrayNode('schema') diff --git a/DependencyInjection/OverblogGraphQLExtension.php b/DependencyInjection/OverblogGraphQLExtension.php index 8646cb1e5..adea09e4b 100644 --- a/DependencyInjection/OverblogGraphQLExtension.php +++ b/DependencyInjection/OverblogGraphQLExtension.php @@ -13,6 +13,7 @@ use GraphQL\Type\Schema; use Overblog\GraphQLBundle\Config\TypeWithOutputFieldsDefinition; +use Overblog\GraphQLBundle\EventListener\ClassLoaderListener; use Symfony\Component\Cache\Adapter\ArrayAdapter; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -45,7 +46,8 @@ public function load(array $configs, ContainerBuilder $container) $this->setConfigBuilders($config, $container); $this->setVersions($config, $container); $this->setShowDebug($config, $container); - $this->setAutoMappingParameters($config, $container); + $this->setDefinitionParameters($config, $container); + $this->setClassLoaderListener($config, $container); $container->setParameter($this->getAlias().'.resources_dir', realpath(__DIR__.'/../Resources')); } @@ -68,13 +70,35 @@ public function getAlias() public function getConfiguration(array $config, ContainerBuilder $container) { - return new Configuration($container->getParameter('kernel.debug')); + return new Configuration( + $container->getParameter('kernel.debug'), + $container->hasParameter('kernel.cache_dir') ? $container->getParameter('kernel.cache_dir') : null + ); } - private function setAutoMappingParameters(array $config, ContainerBuilder $container) + private function setClassLoaderListener(array $config, ContainerBuilder $container) { + $container->setParameter($this->getAlias().'.use_classloader_listener', $config['definitions']['use_classloader_listener']); + if ($config['definitions']['use_classloader_listener']) { + $definition = $container->setDefinition( + $this->getAlias().'.event_listener.classloader_listener', + new Definition(ClassLoaderListener::class) + ); + $definition->setArguments([new Reference($this->getAlias().'.cache_compiler')]); + $definition->addTag('kernel.event_listener', ['event' => 'kernel.request', 'method' => 'load', 'priority' => 255]); + $definition->addTag('kernel.event_listener', ['event' => 'console.command', 'method' => 'load', 'priority' => 255]); + } + } + + private function setDefinitionParameters(array $config, ContainerBuilder $container) + { + // auto mapping $container->setParameter($this->getAlias().'.auto_mapping.enabled', $config['definitions']['auto_mapping']['enabled']); $container->setParameter($this->getAlias().'.auto_mapping.directories', $config['definitions']['auto_mapping']['directories']); + // generator and config + $container->setParameter($this->getAlias().'.default_resolver', $config['definitions']['default_resolver']); + $container->setParameter($this->getAlias().'.class_namespace', $config['definitions']['class_namespace']); + $container->setParameter($this->getAlias().'.cache_dir', $config['definitions']['cache_dir']); } private function setBatchingMethod(array $config, ContainerBuilder $container) diff --git a/Executor/Executor.php b/Executor/Executor.php index acda75b1b..a03c0e522 100644 --- a/Executor/Executor.php +++ b/Executor/Executor.php @@ -11,8 +11,6 @@ namespace Overblog\GraphQLBundle\Executor; -use GraphQL\Executor\ExecutionResult; -use GraphQL\Executor\Promise\Promise; use GraphQL\Executor\Promise\PromiseAdapter; use GraphQL\GraphQL; use GraphQL\Type\Schema; @@ -25,14 +23,7 @@ class Executor implements ExecutorInterface private $promiseAdapter; /** - * @param Schema $schema - * @param string $requestString - * @param null|array $rootValue - * @param null|array $contextValue - * @param null|array $variableValues - * @param null|string $operationName - * - * @return ExecutionResult|Promise + * {@inheritdoc} */ public function execute(Schema $schema, $requestString, $rootValue = null, $contextValue = null, $variableValues = null, $operationName = null) { @@ -49,10 +40,18 @@ public function execute(Schema $schema, $requestString, $rootValue = null, $cont } /** - * @param PromiseAdapter|null $promiseAdapter + * {@inheritdoc} */ public function setPromiseAdapter(PromiseAdapter $promiseAdapter = null) { $this->promiseAdapter = $promiseAdapter; } + + /** + * {@inheritdoc} + */ + public function setDefaultFieldResolver(callable $fn) + { + call_user_func_array(sprintf('\%s::setDefaultFieldResolver', GraphQL::class), func_get_args()); + } } diff --git a/Executor/ExecutorInterface.php b/Executor/ExecutorInterface.php index 588863e6c..1f8ffbf75 100644 --- a/Executor/ExecutorInterface.php +++ b/Executor/ExecutorInterface.php @@ -34,4 +34,9 @@ public function execute(Schema $schema, $requestString, $rootValue = null, $cont * @param PromiseAdapter|null $promiseAdapter */ public function setPromiseAdapter(PromiseAdapter $promiseAdapter = null); + + /** + * @param callable $fn + */ + public function setDefaultFieldResolver(callable $fn); } diff --git a/Generator/TypeGenerator.php b/Generator/TypeGenerator.php index 72672194d..c9c98568e 100644 --- a/Generator/TypeGenerator.php +++ b/Generator/TypeGenerator.php @@ -199,13 +199,13 @@ public function compile(array $configs, $loadClasses = true) $classes = $this->generateClasses($configs, $cacheDir, true); - $content = " \''.$cacheDir, ' => __DIR__ . \'', $content); + if ($loadClasses) { + $content = " \''.$cacheDir, ' => __DIR__ . \'', $content); - file_put_contents($this->getClassesMap(), $content); + file_put_contents($this->getClassesMap(), $content); - if ($loadClasses) { $this->loadClasses(true); } @@ -216,8 +216,14 @@ public function loadClasses($forceReload = false) { if (!self::$classMapLoaded || $forceReload) { $classes = require $this->getClassesMap(); - - $mapClassLoader = new ClassLoader(); + /** @var ClassLoader $mapClassLoader */ + static $mapClassLoader = null; + if (null === $mapClassLoader) { + $mapClassLoader = new ClassLoader(); + $mapClassLoader->setClassMapAuthoritative(true); + } else { + $mapClassLoader->unregister(); + } $mapClassLoader->addClassMap($classes); $mapClassLoader->register(); diff --git a/Request/Executor.php b/Request/Executor.php index b1fbbdc4d..9e2edac74 100644 --- a/Request/Executor.php +++ b/Request/Executor.php @@ -58,13 +58,19 @@ class Executor */ private $promiseAdapter; + /** + * @var callable|null + */ + private $defaultFieldResolver; + public function __construct( ExecutorInterface $executor, EventDispatcherInterface $dispatcher = null, $throwException = false, ErrorHandler $errorHandler = null, $hasDebugInfo = false, - PromiseAdapter $promiseAdapter = null + PromiseAdapter $promiseAdapter = null, + callable $defaultFieldResolver = null ) { $this->executor = $executor; $this->dispatcher = $dispatcher; @@ -72,6 +78,7 @@ public function __construct( $this->errorHandler = $errorHandler; $hasDebugInfo ? $this->enabledDebugInfo() : $this->disabledDebugInfo(); $this->promiseAdapter = $promiseAdapter; + $this->defaultFieldResolver = $defaultFieldResolver; } public function setExecutor(ExecutorInterface $executor) @@ -166,6 +173,10 @@ public function execute(array $data, array $context = [], $schemaName = null) $startMemoryUsage = memory_get_usage(true); $this->executor->setPromiseAdapter($this->promiseAdapter); + // this is needed when not using only generated types + if ($this->defaultFieldResolver) { + $this->executor->setDefaultFieldResolver($this->defaultFieldResolver); + } $result = $this->executor->execute( $schema, diff --git a/Resources/config/services.yml b/Resources/config/services.yml index 4a6916e5a..db8b22c16 100644 --- a/Resources/config/services.yml +++ b/Resources/config/services.yml @@ -1,7 +1,3 @@ -parameters: - overblog_graphql.default_resolver: [Overblog\GraphQLBundle\Resolver\Resolver, defaultResolveFn] - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\__DEFINITIONS__" - services: overblog_graphql.error_handler: class: Overblog\GraphQLBundle\Error\ErrorHandler @@ -24,6 +20,7 @@ services: - "@overblog_graphql.error_handler" - false - "@overblog_graphql.promise_adapter" + - "%overblog_graphql.default_resolver%" calls: - ["setMaxQueryComplexity", ["%overblog_graphql.query_max_complexity%"]] - ["setMaxQueryDepth", ["%overblog_graphql.query_max_depth%"]] @@ -69,9 +66,9 @@ services: overblog_graphql.cache_compiler: class: Overblog\GraphQLBundle\Generator\TypeGenerator arguments: - - "%overblog_graphql.type_class_namespace%" + - "%overblog_graphql.class_namespace%" - ["%overblog_graphql.resources_dir%/skeleton"] - - "%kernel.cache_dir%/overblog/graph-bundle/__definitions__" + - "%overblog_graphql.cache_dir%" - "%overblog_graphql.default_resolver%" calls: - ["addUseStatement", ["Symfony\\Component\\DependencyInjection\\ContainerInterface"]] @@ -79,14 +76,6 @@ services: - ["addImplement", ["Overblog\\GraphQLBundle\\Definition\\Type\\GeneratedTypeInterface"]] - ["setExpressionLanguage", ["@overblog_graphql.expression_language"]] - overblog_graphql.event_listener.classloader_listener: - arguments: - - "@overblog_graphql.cache_compiler" - class: Overblog\GraphQLBundle\EventListener\ClassLoaderListener - tags: - - { name: kernel.event_listener, event: kernel.request, method: load, priority: 255 } - - { name: kernel.event_listener, event: console.command, method: load, priority: 255 } - overblog_graphql.event_listener.request_file_listener: class: Overblog\GraphQLBundle\EventListener\RequestFilesListener arguments: diff --git a/Resources/doc/index.md b/Resources/doc/index.md index b40e3abe6..cd8e79058 100644 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -7,7 +7,7 @@ It also supports batching using libs like [ReactRelayNetworkLayer](https://githu Requirements ------------ -PHP >= 5.4 +PHP >= 5.5 Installation ------------ @@ -54,4 +54,40 @@ overblog_graphql_graphiql: resource: "@OverblogGraphQLBundle/Resources/config/routing/graphiql.yml" ``` -Now you can define your [graphQL schema](definitions/index.md). \ No newline at end of file +**e)** Use composer ClassLoader to load generated class (optional but recommended) + +Using composer ClassLoader will help keeping hand on loader optimization +in production environment... + +First start by some configuration: + +```yaml +overblog_graphql: + definitions: + # disable listener the bundle out of box classLoader + use_classloader_listener: false + # change classes cache dir (recommends using a directory that will be committed) + cache_dir: "/my/path/to/my/generated/classes" + # Can also change the namespace + #class_namespace: "Overblog\\GraphQLBundle\\__DEFINITIONS__" +``` + +then enable composer autoloader in project `composer.json`: + +```json +{ + "autoload": { + "psr-4": { + "Overblog\\GraphQLBundle\\__DEFINITIONS__\\": "my/path/to/my/generated/classes/" + } + } +} +``` + +Finish by dumping the new autoloader. + +```bash +composer dump-autoload +``` + +Now you can define your [graphQL schema](definitions/index.md). diff --git a/Tests/Functional/App/config/access/config.yml b/Tests/Functional/App/config/access/config.yml index e61b88ae5..3c1d06741 100644 --- a/Tests/Functional/App/config/access/config.yml +++ b/Tests/Functional/App/config/access/config.yml @@ -4,11 +4,10 @@ imports: - { resource: ../connection/services.yml } - { resource: ../mutation/services.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\Access\\__DEFINITIONS__" - overblog_graphql: definitions: + use_classloader_listener: false + class_namespace: "Overblog\\GraphQLBundle\\Access\\__DEFINITIONS__" schema: query: RootQuery mutation: RootMutation diff --git a/Tests/Functional/App/config/connection/config.yml b/Tests/Functional/App/config/connection/config.yml index 57399cc0e..2aecad05a 100644 --- a/Tests/Functional/App/config/connection/config.yml +++ b/Tests/Functional/App/config/connection/config.yml @@ -2,11 +2,9 @@ imports: - { resource: ../config.yml } - { resource: services.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__" - overblog_graphql: definitions: + class_namespace: "Overblog\\GraphQLBundle\\Connection\\__DEFINITIONS__" schema: query: Query mutation: ~ diff --git a/Tests/Functional/App/config/connectionWithCORS/config.yml b/Tests/Functional/App/config/connectionWithCORS/config.yml index 443f17f45..a7105194d 100644 --- a/Tests/Functional/App/config/connectionWithCORS/config.yml +++ b/Tests/Functional/App/config/connectionWithCORS/config.yml @@ -1,9 +1,8 @@ imports: - { resource: ../connection/config.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\ConnectionWithCORSPreflightOptions\\__DEFINITIONS__" - overblog_graphql: + definitions: + class_namespace: "Overblog\\GraphQLBundle\\ConnectionWithCORSPreflightOptions\\__DEFINITIONS__" security: handle_cors: true diff --git a/Tests/Functional/App/config/customScalar/config.yml b/Tests/Functional/App/config/customScalar/config.yml index 5f68f327d..573cac4a4 100644 --- a/Tests/Functional/App/config/customScalar/config.yml +++ b/Tests/Functional/App/config/customScalar/config.yml @@ -1,11 +1,9 @@ imports: - { resource: ../config.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\CustomScalar\\__DEFINITIONS__" - overblog_graphql: definitions: + class_namespace: "Overblog\\GraphQLBundle\\CustomScalar\\__DEFINITIONS__" schema: query: Query mutation: ~ diff --git a/Tests/Functional/App/config/definition/config.yml b/Tests/Functional/App/config/definition/config.yml index dddbf36c3..cd2c7930c 100644 --- a/Tests/Functional/App/config/definition/config.yml +++ b/Tests/Functional/App/config/definition/config.yml @@ -1,9 +1,6 @@ imports: - { resource: ../config.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\Definition\\__DEFINITIONS__" - overblog_graphql: definitions: schema: diff --git a/Tests/Functional/App/config/exception/config.yml b/Tests/Functional/App/config/exception/config.yml index 92d4335bf..efc854216 100644 --- a/Tests/Functional/App/config/exception/config.yml +++ b/Tests/Functional/App/config/exception/config.yml @@ -2,11 +2,9 @@ imports: - { resource: ../config.yml } - { resource: services.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\Exception\\__DEFINITIONS__" - overblog_graphql: definitions: + class_namespace: "Overblog\\GraphQLBundle\\Exception\\__DEFINITIONS__" exceptions: errors: - "InvalidArgumentException" diff --git a/Tests/Functional/App/config/global/config.yml b/Tests/Functional/App/config/global/config.yml index 7509022a6..e8cf40b5b 100644 --- a/Tests/Functional/App/config/global/config.yml +++ b/Tests/Functional/App/config/global/config.yml @@ -1,9 +1,6 @@ imports: - { resource: ../config.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\RelayGlobal\\__DEFINITIONS__" - services: overblog_graphql.test.resolver.global: class: Overblog\GraphQLBundle\Tests\Functional\App\Resolver\GlobalResolver @@ -12,6 +9,7 @@ services: overblog_graphql: definitions: + class_namespace: "Overblog\\GraphQLBundle\\RelayGlobal\\__DEFINITIONS__" config_validation: false schema: query: Query diff --git a/Tests/Functional/App/config/mutation/config.yml b/Tests/Functional/App/config/mutation/config.yml index 6704d8c6a..9cf47cdcc 100644 --- a/Tests/Functional/App/config/mutation/config.yml +++ b/Tests/Functional/App/config/mutation/config.yml @@ -2,11 +2,9 @@ imports: - { resource: ../config.yml } - { resource: services.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\Mutation\\__DEFINITIONS__" - overblog_graphql: definitions: + class_namespace: "Overblog\\GraphQLBundle\\Mutation\\__DEFINITIONS__" internal_error_message: "Mutation has failled." schema: query: RootMutation diff --git a/Tests/Functional/App/config/node/config.yml b/Tests/Functional/App/config/node/config.yml index 8bf77d792..92b0adedd 100644 --- a/Tests/Functional/App/config/node/config.yml +++ b/Tests/Functional/App/config/node/config.yml @@ -1,9 +1,6 @@ imports: - { resource: ../config.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\Node\\__DEFINITIONS__" - services: overblog_graphql.test.resolver.node: class: Overblog\GraphQLBundle\Tests\Functional\App\Resolver\NodeResolver @@ -16,6 +13,7 @@ services: overblog_graphql: definitions: + class_namespace: "Overblog\\GraphQLBundle\\Node\\__DEFINITIONS__" schema: query: Query mutation: ~ diff --git a/Tests/Functional/App/config/plural/config.yml b/Tests/Functional/App/config/plural/config.yml index 4ca04b16e..981912b47 100644 --- a/Tests/Functional/App/config/plural/config.yml +++ b/Tests/Functional/App/config/plural/config.yml @@ -1,9 +1,6 @@ imports: - { resource: ../config.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\Plural\\__DEFINITIONS__" - services: overblog_graphql.test.resolver.plural: class: Overblog\GraphQLBundle\Tests\Functional\App\Resolver\PluralResolver @@ -12,6 +9,7 @@ services: overblog_graphql: definitions: + class_namespace: "Overblog\\GraphQLBundle\\Plural\\__DEFINITIONS__" schema: query: Query mutation: ~ diff --git a/Tests/Functional/App/config/public/config.yml b/Tests/Functional/App/config/public/config.yml index 2af33ef8a..2583e17f5 100644 --- a/Tests/Functional/App/config/public/config.yml +++ b/Tests/Functional/App/config/public/config.yml @@ -2,11 +2,9 @@ imports: - { resource: ../config.yml } - { resource: ../security.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\PublicField\\__DEFINITIONS__" - overblog_graphql: definitions: + class_namespace: "Overblog\\GraphQLBundle\\PublicField\\__DEFINITIONS__" schema: query: RootQuery mappings: diff --git a/Tests/Functional/App/config/queryComplexity/config.yml b/Tests/Functional/App/config/queryComplexity/config.yml index b1772deec..0d9e8003c 100644 --- a/Tests/Functional/App/config/queryComplexity/config.yml +++ b/Tests/Functional/App/config/queryComplexity/config.yml @@ -2,13 +2,11 @@ imports: - { resource: ../config.yml } - { resource: ../connection/services.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\QueryComplexity\\__DEFINITIONS__" - overblog_graphql: security: query_max_complexity: '10' definitions: + class_namespace: "Overblog\\GraphQLBundle\\QueryComplexity\\__DEFINITIONS__" schema: query: Query mutation: ~ diff --git a/Tests/Functional/App/config/queryComplexityEnv/config.yml b/Tests/Functional/App/config/queryComplexityEnv/config.yml index 541368f10..feb9a97d9 100644 --- a/Tests/Functional/App/config/queryComplexityEnv/config.yml +++ b/Tests/Functional/App/config/queryComplexityEnv/config.yml @@ -3,13 +3,13 @@ imports: - { resource: ../connection/services.yml } parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\QueryComplexity\\__DEFINITIONS__" env(GRAPHQL_QUERY_MAX_COMPLEXITY): 10 overblog_graphql: security: query_max_complexity: '%env(GRAPHQL_QUERY_MAX_COMPLEXITY)%' definitions: + class_namespace: "Overblog\\GraphQLBundle\\QueryComplexity\\__DEFINITIONS__" schema: query: Query mutation: ~ diff --git a/Tests/Functional/App/config/queryMaxDepth/config.yml b/Tests/Functional/App/config/queryMaxDepth/config.yml index 7b96b0823..2402eabbc 100644 --- a/Tests/Functional/App/config/queryMaxDepth/config.yml +++ b/Tests/Functional/App/config/queryMaxDepth/config.yml @@ -2,13 +2,11 @@ imports: - { resource: ../config.yml } - { resource: ../connection/services.yml } -parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\QueryComplexity\\__DEFINITIONS__" - overblog_graphql: security: query_max_depth: '3' definitions: + class_namespace: "Overblog\\GraphQLBundle\\QueryComplexity\\__DEFINITIONS__" schema: query: Query mutation: ~ diff --git a/Tests/Functional/App/config/queryMaxDepthEnv/config.yml b/Tests/Functional/App/config/queryMaxDepthEnv/config.yml index 490be966f..6124af3e6 100644 --- a/Tests/Functional/App/config/queryMaxDepthEnv/config.yml +++ b/Tests/Functional/App/config/queryMaxDepthEnv/config.yml @@ -3,13 +3,13 @@ imports: - { resource: ../connection/services.yml } parameters: - overblog_graphql.type_class_namespace: "Overblog\\GraphQLBundle\\QueryComplexity\\__DEFINITIONS__" env(GRAPHQL_QUERY_MAX_DEPTH): 3 overblog_graphql: security: query_max_depth: '%env(GRAPHQL_QUERY_MAX_DEPTH)%' definitions: + class_namespace: "Overblog\\GraphQLBundle\\QueryComplexity\\__DEFINITIONS__" schema: query: Query mutation: ~ diff --git a/Tests/Functional/Security/AccessTest.php b/Tests/Functional/Security/AccessTest.php index 1f5716947..f03a08942 100644 --- a/Tests/Functional/Security/AccessTest.php +++ b/Tests/Functional/Security/AccessTest.php @@ -11,11 +11,16 @@ namespace Overblog\GraphQLBundle\Tests\Functional\Security; +use Composer\Autoload\ClassLoader; use Overblog\GraphQLBundle\Tests\Functional\App\Mutation\SimpleMutationWithThunkFieldsMutation; use Overblog\GraphQLBundle\Tests\Functional\TestCase; +use Symfony\Component\HttpKernel\Kernel; class AccessTest extends TestCase { + /** @var ClassLoader */ + private $loader; + private $userNameQuery = 'query { user { name } }'; private $userRolesQuery = 'query { user { roles } }'; @@ -45,6 +50,30 @@ class AccessTest extends TestCase } EOF; + public function setUp() + { + parent::setUp(); + // load types + /** @var ClassLoader $loader */ + $loader = new ClassLoader(); + $loader->addPsr4( + 'Overblog\\GraphQLBundle\\Access\\__DEFINITIONS__\\', + '/tmp/OverblogGraphQLBundle/'.Kernel::VERSION.'/access/cache/overbloggraphbundletestaccess/overblog/graphql-bundle/__definitions__' + ); + $loader->register(); + $this->loader = $loader; + } + + /** + * @expectedException \RuntimeException + * @expectedExceptionMessage Type class "Overblog\\GraphQLBundle\\Access\\__DEFINITIONS__\\PageInfoType" not found. If you are using your own classLoader verify the path and the namespace please. + */ + public function testCustomClassLoaderNotRegister() + { + $this->loader->unregister(); + $this->assertResponse($this->userNameQuery, [], static::ANONYMOUS_USER, 'access'); + } + public function testNotAuthenticatedUserAccessToUserName() { $expected = [ From 7d03b9a3a697b6d2afcf0da773d3c5ae30ce0d25 Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Thu, 21 Sep 2017 17:45:20 +0200 Subject: [PATCH 5/6] Upgrade assets versions --- DependencyInjection/Configuration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 04b8d07ea..227ee36c3 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -176,8 +176,8 @@ public function getConfigTreeBuilder() ->arrayNode('versions') ->addDefaultsIfNotSet() ->children() - ->scalarNode('graphiql')->defaultValue('0.9')->end() - ->scalarNode('react')->defaultValue('15.4')->end() + ->scalarNode('graphiql')->defaultValue('0.11')->end() + ->scalarNode('react')->defaultValue('15.6')->end() ->scalarNode('fetch')->defaultValue('2.0')->end() ->enumNode('relay')->values(['modern', 'classic'])->defaultValue('classic')->end() ->end() From 4d1fb07b421c3e5be3b67930f49c44cf1e8114a4 Mon Sep 17 00:00:00 2001 From: Jeremiah VALERIE Date: Fri, 22 Sep 2017 17:44:12 +0200 Subject: [PATCH 6/6] Accept yaml extension --- Config/Parser/{YmlParser.php => YamlParser.php} | 6 +++--- DependencyInjection/Compiler/ConfigTypesPass.php | 1 + .../MutationTaggedServiceMappingTaggedPass.php | 5 ----- .../Compiler/ResolverTaggedServiceMappingPass.php | 5 ----- .../Compiler/TaggedServiceMappingPass.php | 3 --- .../Compiler/TypeTaggedServiceMappingPass.php | 5 ----- DependencyInjection/Configuration.php | 12 +++++++++++- .../OverblogGraphQLTypesExtension.php | 6 ++++-- Resources/doc/definitions/type-system/index.md | 2 +- .../OverblogGraphQLTypesExtensionTest.php | 2 +- .../mapping/{yml => yaml}/broken.types.yml | 0 Tests/Functional/App/config/access/config.yml | 2 +- .../{connection.types.yml => connection.types.yaml} | 0 Tests/Functional/App/config/customScalar/config.yml | 2 +- Tests/Functional/App/config/definition/config.yml | 2 +- Tests/Functional/App/config/exception/config.yml | 2 +- Tests/Functional/App/config/global/config.yml | 2 +- Tests/Functional/App/config/mutation/config.yml | 2 +- Tests/Functional/App/config/node/config.yml | 2 +- Tests/Functional/App/config/public/config.yml | 2 +- .../Functional/App/config/queryComplexity/config.yml | 2 +- .../App/config/queryComplexityEnv/config.yml | 2 +- Tests/Functional/App/config/queryMaxDepth/config.yml | 2 +- .../App/config/queryMaxDepthEnv/config.yml | 2 +- 24 files changed, 33 insertions(+), 38 deletions(-) rename Config/Parser/{YmlParser.php => YamlParser.php} (89%) rename Tests/DependencyInjection/mapping/{yml => yaml}/broken.types.yml (100%) rename Tests/Functional/App/config/connection/mapping/{connection.types.yml => connection.types.yaml} (100%) diff --git a/Config/Parser/YmlParser.php b/Config/Parser/YamlParser.php similarity index 89% rename from Config/Parser/YmlParser.php rename to Config/Parser/YamlParser.php index 23b2e13e9..3561ceaa7 100644 --- a/Config/Parser/YmlParser.php +++ b/Config/Parser/YamlParser.php @@ -16,9 +16,9 @@ use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\Finder\SplFileInfo; use Symfony\Component\Yaml\Exception\ParseException; -use Symfony\Component\Yaml\Parser as YamlParser; +use Symfony\Component\Yaml\Parser; -class YmlParser implements ParserInterface +class YamlParser implements ParserInterface { private static $yamlParser; @@ -31,7 +31,7 @@ class YmlParser implements ParserInterface public static function parse(SplFileInfo $file, ContainerBuilder $container) { if (null === self::$yamlParser) { - self::$yamlParser = new YamlParser(); + self::$yamlParser = new Parser(); } try { diff --git a/DependencyInjection/Compiler/ConfigTypesPass.php b/DependencyInjection/Compiler/ConfigTypesPass.php index a04479cbd..7264f0b52 100644 --- a/DependencyInjection/Compiler/ConfigTypesPass.php +++ b/DependencyInjection/Compiler/ConfigTypesPass.php @@ -36,6 +36,7 @@ public function process(ContainerBuilder $container) $aliases = call_user_func($class.'::getAliases'); $this->setTypeServiceDefinition($container, $class, $aliases); } + $container->getParameterBag()->remove('overblog_graphql_types.config'); } private function setTypeServiceDefinition(ContainerBuilder $container, $class, array $aliases) diff --git a/DependencyInjection/Compiler/MutationTaggedServiceMappingTaggedPass.php b/DependencyInjection/Compiler/MutationTaggedServiceMappingTaggedPass.php index 123099fc4..c521bc4d2 100644 --- a/DependencyInjection/Compiler/MutationTaggedServiceMappingTaggedPass.php +++ b/DependencyInjection/Compiler/MutationTaggedServiceMappingTaggedPass.php @@ -18,11 +18,6 @@ protected function getTagName() return 'overblog_graphql.mutation'; } - protected function getParameterName() - { - return 'overblog_graphql.mutations_mapping'; - } - protected function getResolverServiceID() { return 'overblog_graphql.mutation_resolver'; diff --git a/DependencyInjection/Compiler/ResolverTaggedServiceMappingPass.php b/DependencyInjection/Compiler/ResolverTaggedServiceMappingPass.php index 0f38342db..6cf8dcdfa 100644 --- a/DependencyInjection/Compiler/ResolverTaggedServiceMappingPass.php +++ b/DependencyInjection/Compiler/ResolverTaggedServiceMappingPass.php @@ -18,11 +18,6 @@ protected function getTagName() return 'overblog_graphql.resolver'; } - protected function getParameterName() - { - return 'overblog_graphql.resolvers_mapping'; - } - protected function checkRequirements($id, array $tag) { parent::checkRequirements($id, $tag); diff --git a/DependencyInjection/Compiler/TaggedServiceMappingPass.php b/DependencyInjection/Compiler/TaggedServiceMappingPass.php index d6d9d9386..322659ef2 100644 --- a/DependencyInjection/Compiler/TaggedServiceMappingPass.php +++ b/DependencyInjection/Compiler/TaggedServiceMappingPass.php @@ -54,7 +54,6 @@ private function getTaggedServiceMapping(ContainerBuilder $container, $tagName) public function process(ContainerBuilder $container) { $mapping = $this->getTaggedServiceMapping($container, $this->getTagName()); - $container->setParameter($this->getParameterName(), $mapping); $resolverDefinition = $container->findDefinition($this->getResolverServiceID()); foreach ($mapping as $name => $options) { @@ -101,6 +100,4 @@ protected function checkRequirements($id, array $tag) abstract protected function getTagName(); abstract protected function getResolverServiceID(); - - abstract protected function getParameterName(); } diff --git a/DependencyInjection/Compiler/TypeTaggedServiceMappingPass.php b/DependencyInjection/Compiler/TypeTaggedServiceMappingPass.php index 03f587613..54b7dd10d 100644 --- a/DependencyInjection/Compiler/TypeTaggedServiceMappingPass.php +++ b/DependencyInjection/Compiler/TypeTaggedServiceMappingPass.php @@ -18,11 +18,6 @@ protected function getTagName() return 'overblog_graphql.type'; } - protected function getParameterName() - { - return 'overblog_graphql.types_mapping'; - } - protected function getResolverServiceID() { return 'overblog_graphql.type_resolver'; diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 227ee36c3..973e831ff 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -98,8 +98,18 @@ public function getConfigTreeBuilder() ->arrayNode('types') ->prototype('array') ->addDefaultsIfNotSet() + ->beforeNormalization() + ->ifTrue(function ($v) { + return isset($v['type']) && $v['type'] === 'yml'; + }) + ->then(function ($v) { + $v['type'] = 'yaml'; + + return $v; + }) + ->end() ->children() - ->enumNode('type')->isRequired()->values(['yml', 'xml'])->end() + ->enumNode('type')->isRequired()->values(['yaml', 'xml'])->end() ->scalarNode('dir')->defaultNull()->end() ->end() ->end() diff --git a/DependencyInjection/OverblogGraphQLTypesExtension.php b/DependencyInjection/OverblogGraphQLTypesExtension.php index 1c496ebc5..2eff2930e 100644 --- a/DependencyInjection/OverblogGraphQLTypesExtension.php +++ b/DependencyInjection/OverblogGraphQLTypesExtension.php @@ -19,7 +19,9 @@ class OverblogGraphQLTypesExtension extends Extension { - private static $configTypes = ['yml', 'xml']; + private static $configTypes = ['yaml', 'xml']; + + private static $typeExtensions = ['yaml' => '{yaml,yml}', 'xml' => 'xml']; public function load(array $configs, ContainerBuilder $container) { @@ -112,7 +114,7 @@ private function detectFilesByType(ContainerBuilder $container, $path, $type = n foreach ($types as $type) { try { - $finder->files()->in($path)->name('*.types.'.$type); + $finder->files()->in($path)->name('*.types.'.self::$typeExtensions[$type]); } catch (\InvalidArgumentException $e) { continue; } diff --git a/Resources/doc/definitions/type-system/index.md b/Resources/doc/definitions/type-system/index.md index 81859323e..76a4b1016 100644 --- a/Resources/doc/definitions/type-system/index.md +++ b/Resources/doc/definitions/type-system/index.md @@ -27,7 +27,7 @@ Types can be define 3 different ways: mappings: types: - - type: yml # or xml + type: yaml # or xml dir: "%kernel.root_dir%/.../mapping" ``` diff --git a/Tests/DependencyInjection/OverblogGraphQLTypesExtensionTest.php b/Tests/DependencyInjection/OverblogGraphQLTypesExtensionTest.php index c560e2fc5..b2355b9b6 100644 --- a/Tests/DependencyInjection/OverblogGraphQLTypesExtensionTest.php +++ b/Tests/DependencyInjection/OverblogGraphQLTypesExtensionTest.php @@ -61,7 +61,7 @@ public function testDuplicatedType() */ public function testBrokenYmlOnPrepend() { - $this->extension->containerPrependExtensionConfig($this->getBrokenMappingConfig('yml'), $this->container); + $this->extension->containerPrependExtensionConfig($this->getBrokenMappingConfig('yaml'), $this->container); } /** diff --git a/Tests/DependencyInjection/mapping/yml/broken.types.yml b/Tests/DependencyInjection/mapping/yaml/broken.types.yml similarity index 100% rename from Tests/DependencyInjection/mapping/yml/broken.types.yml rename to Tests/DependencyInjection/mapping/yaml/broken.types.yml diff --git a/Tests/Functional/App/config/access/config.yml b/Tests/Functional/App/config/access/config.yml index 3c1d06741..cd2c6a234 100644 --- a/Tests/Functional/App/config/access/config.yml +++ b/Tests/Functional/App/config/access/config.yml @@ -14,5 +14,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/access/mapping" diff --git a/Tests/Functional/App/config/connection/mapping/connection.types.yml b/Tests/Functional/App/config/connection/mapping/connection.types.yaml similarity index 100% rename from Tests/Functional/App/config/connection/mapping/connection.types.yml rename to Tests/Functional/App/config/connection/mapping/connection.types.yaml diff --git a/Tests/Functional/App/config/customScalar/config.yml b/Tests/Functional/App/config/customScalar/config.yml index 573cac4a4..375a96a54 100644 --- a/Tests/Functional/App/config/customScalar/config.yml +++ b/Tests/Functional/App/config/customScalar/config.yml @@ -10,5 +10,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/customScalar/mapping" diff --git a/Tests/Functional/App/config/definition/config.yml b/Tests/Functional/App/config/definition/config.yml index cd2c7930c..095a657c1 100644 --- a/Tests/Functional/App/config/definition/config.yml +++ b/Tests/Functional/App/config/definition/config.yml @@ -8,5 +8,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/definition/mapping" diff --git a/Tests/Functional/App/config/exception/config.yml b/Tests/Functional/App/config/exception/config.yml index efc854216..6a0a5b609 100644 --- a/Tests/Functional/App/config/exception/config.yml +++ b/Tests/Functional/App/config/exception/config.yml @@ -14,5 +14,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/exception/mapping" diff --git a/Tests/Functional/App/config/global/config.yml b/Tests/Functional/App/config/global/config.yml index e8cf40b5b..6b30cf772 100644 --- a/Tests/Functional/App/config/global/config.yml +++ b/Tests/Functional/App/config/global/config.yml @@ -17,5 +17,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/global/mapping" diff --git a/Tests/Functional/App/config/mutation/config.yml b/Tests/Functional/App/config/mutation/config.yml index 9cf47cdcc..f098943c9 100644 --- a/Tests/Functional/App/config/mutation/config.yml +++ b/Tests/Functional/App/config/mutation/config.yml @@ -12,5 +12,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/mutation/mapping" diff --git a/Tests/Functional/App/config/node/config.yml b/Tests/Functional/App/config/node/config.yml index 92b0adedd..3ef301b6d 100644 --- a/Tests/Functional/App/config/node/config.yml +++ b/Tests/Functional/App/config/node/config.yml @@ -20,5 +20,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/node/mapping" diff --git a/Tests/Functional/App/config/public/config.yml b/Tests/Functional/App/config/public/config.yml index 2583e17f5..901ce6e7d 100644 --- a/Tests/Functional/App/config/public/config.yml +++ b/Tests/Functional/App/config/public/config.yml @@ -10,5 +10,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/public/mapping" diff --git a/Tests/Functional/App/config/queryComplexity/config.yml b/Tests/Functional/App/config/queryComplexity/config.yml index 0d9e8003c..d9e6ba96c 100644 --- a/Tests/Functional/App/config/queryComplexity/config.yml +++ b/Tests/Functional/App/config/queryComplexity/config.yml @@ -13,5 +13,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/queryComplexity/mapping" diff --git a/Tests/Functional/App/config/queryComplexityEnv/config.yml b/Tests/Functional/App/config/queryComplexityEnv/config.yml index feb9a97d9..e2eb1d756 100644 --- a/Tests/Functional/App/config/queryComplexityEnv/config.yml +++ b/Tests/Functional/App/config/queryComplexityEnv/config.yml @@ -16,5 +16,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/queryComplexity/mapping" diff --git a/Tests/Functional/App/config/queryMaxDepth/config.yml b/Tests/Functional/App/config/queryMaxDepth/config.yml index 2402eabbc..8f24160cd 100644 --- a/Tests/Functional/App/config/queryMaxDepth/config.yml +++ b/Tests/Functional/App/config/queryMaxDepth/config.yml @@ -13,5 +13,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/queryMaxDepth/mapping" diff --git a/Tests/Functional/App/config/queryMaxDepthEnv/config.yml b/Tests/Functional/App/config/queryMaxDepthEnv/config.yml index 6124af3e6..ae134d970 100644 --- a/Tests/Functional/App/config/queryMaxDepthEnv/config.yml +++ b/Tests/Functional/App/config/queryMaxDepthEnv/config.yml @@ -16,5 +16,5 @@ overblog_graphql: mappings: types: - - type: yml + type: yaml dir: "%kernel.root_dir%/config/queryMaxDepth/mapping"