Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ public function getConfigTreeBuilder()
->arrayNode('versions')
->addDefaultsIfNotSet()
->children()
->scalarNode('graphiql')->defaultValue('0.7.8')->end()
->scalarNode('react')->defaultValue('15.3.2')->end()
->scalarNode('fetch')->defaultValue('2.0.1')->end()
->scalarNode('graphiql')->defaultValue('0.9')->end()
->scalarNode('react')->defaultValue('15.4')->end()
->scalarNode('fetch')->defaultValue('2.0')->end()
->end()
->end()
->end();
Expand Down
6 changes: 4 additions & 2 deletions Generator/TypeGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ protected function generateResolve(array $value)
$fieldOptions['resolve'] = $this->defaultResolver;
}
$resolveCallback = parent::generateResolve($fieldOptions);
$resolveCallback = ltrim($this->prefixCodeWithSpaces($resolveCallback));

if (!$accessIsSet || true === $fieldOptions['access']) { // access granted to this field
if ('null' === $resolveCallback) {
Expand All @@ -90,7 +91,7 @@ protected function generateResolve(array $value)
$resolveInfoClass = $this->shortenClassName('\\GraphQL\\Type\\Definition\\ResolveInfo');

$code = <<<'CODE'
function ($value, $args, $context, %s $info) <closureUseStatements> {
function ($value, $args, $context, %s $info) <closureUseStatements>{
<spaces><spaces>$resolverCallback = %s;
<spaces><spaces>return call_user_func_array($resolverCallback, [$value, new %s($args), $context, $info]);
<spaces>}
Expand Down Expand Up @@ -130,6 +131,7 @@ function ($value, $args, $context, %s $info) <closureUseStatements> {
protected function generateComplexity(array $value)
{
$resolveComplexity = parent::generateComplexity($value);
$resolveComplexity = ltrim($this->prefixCodeWithSpaces($resolveComplexity));

if ('null' === $resolveComplexity) {
return $resolveComplexity;
Expand All @@ -138,7 +140,7 @@ protected function generateComplexity(array $value)
$argumentClass = $this->shortenClassName('\\Overblog\\GraphQLBundle\\Definition\\Argument');

$code = <<<'CODE'
function ($childrenComplexity, $args = []) <closureUseStatements> {
function ($childrenComplexity, $args = []) <closureUseStatements>{
<spaces><spaces>$resolveComplexity = %s;

<spaces><spaces>return call_user_func_array($resolveComplexity, [$childrenComplexity, new %s($args)]);
Expand Down
6 changes: 3 additions & 3 deletions Tests/Functional/Command/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ type Query {
type User {
# the user name
name: String
friends(after: String = null, first: Int = null, before: String = null, last: Int = null): friendConnection
friendsForward(after: String = null, first: Int = null): userConnection
friendsBackward(before: String = null, last: Int = null): userConnection
friends(after: String, first: Int, before: String, last: Int): friendConnection
friendsForward(after: String, first: Int): userConnection
friendsBackward(before: String, last: Int): userConnection
}

# A connection to a list of items.
Expand Down
Loading