Skip to content

Commit f6c5682

Browse files
committed
updates for the simple installation
1 parent 00f4b33 commit f6c5682

File tree

5 files changed

+9
-13
lines changed

5 files changed

+9
-13
lines changed

Diff for: Command/GenerateSchemaCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace AppBundle\Command;
3+
namespace Youshido\GraphQLBundle\Command;
44

55
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
66
use Symfony\Component\Console\Input\InputArgument;
@@ -14,7 +14,7 @@ class GenerateSchemaCommand extends ContainerAwareCommand
1414
protected function configure()
1515
{
1616
$this
17-
->setName('graphql:generate-schema')
17+
->setName('graphql:schema:generate')
1818
->setDescription('Generates GraphQL Schema class')
1919
->addArgument('bundle', InputArgument::REQUIRED, 'Bundle to generate class to');
2020
}

Diff for: Controller/GraphQLController.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public function defaultAction()
4141
}
4242

4343
$processor = $this->get('youshido.graphql.processor');
44-
if ($schemaClass = $this->getParameter('youshido.graphql.schema_class')) {
44+
if ($this->container->hasParameter('youshido.graphql.schema_class')) {
45+
$schemaClass = $this->getParameter('youshido.graphql.schema_class');
4546
if (!class_exists($schemaClass)) {
4647
throw new ConfigurationException('Schema class ' . $schemaClass . ' does not exist');
4748
}
@@ -52,4 +53,4 @@ public function defaultAction()
5253
return new JsonResponse($processor->getResponseData(), 200, $this->getParameter('youshido.graphql.response_headers'));
5354
}
5455

55-
}
56+
}

Diff for: DependencyInjection/Configuration.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function getConfigTreeBuilder()
2323

2424
$rootNode
2525
->children()
26-
->scalarNode('query_schema')->cannotBeEmpty()->end()
26+
->scalarNode('schema_class')->cannotBeEmpty()->end()
2727
->scalarNode('logger')->defaultValue(null)->end()
2828
->arrayNode('response_headers')
2929
->prototype('array')

Diff for: DependencyInjection/GraphQLExtension.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function load(array $configs, ContainerBuilder $container)
2929
$responseHeaders[$responseHeader['name']] = $responseHeader['value'];
3030
}
3131

32-
$container->setParameter('youshido.graphql.project_schema', $this->getConfig('query_schema', null));
32+
$container->setParameter('youshido.graphql.schema_class', $this->getConfig('schema_class', null));
3333
$container->setParameter('youshido.graphql.response_headers', $responseHeaders);
3434
$container->setParameter('youshido.graphql.logger', $this->getConfig('logger', null));
3535

@@ -40,7 +40,7 @@ public function load(array $configs, ContainerBuilder $container)
4040
private function getDefaultHeaders()
4141
{
4242
return [
43-
['name' => 'Access-Control-Allow-Origin', 'value' => '*'],
43+
['name' => 'Access-Control-Allow-Origin', 'value' => '*'],
4444
];
4545
}
4646

Diff for: Resources/config/services.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,5 @@ services:
66
youshido.graphql.processor:
77
class: %youshido.graphql.processor.class%
88
calls:
9-
- [ setSchema, [@youshido.graphql.schema]]
10-
- [ setContainer, [@service_container]]
9+
- [ setContainer, ['@service_container']]
1110
- [ setLogger, [%youshido.graphql.logger%] ]
12-
13-
14-
youshido.graphql.schema:
15-
class: %youshido.graphql.project_schema%

0 commit comments

Comments
 (0)