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
4 changes: 4 additions & 0 deletions DependencyInjection/TypesConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ private function addConfigSelection()
->arrayNode('values')
->useAttributeAsKey('name')
->prototype('array')
->beforeNormalization()
->ifTrue(function ($v) { return !is_null($v) && !is_array($v); })
->then(function ($v) { return ['value' => $v]; })
->end()
->isRequired()
->children()
->scalarNode('value')->end()
Expand Down
4 changes: 2 additions & 2 deletions Tests/Functional/Command/GraphDumpSchemaCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testExecute()
$application->add(new GraphDumpSchemaCommand());

$command = $application->find('graph:dump-schema');
$file = $kernel->getCacheDir().'/schema.yml';
$file = $kernel->getCacheDir().'/schema.json';

$commandTester = new CommandTester($command);
$commandTester->execute(
Expand All @@ -38,6 +38,6 @@ public function testExecute()
);

$this->assertEquals(0, $commandTester->getStatusCode());
$this->assertEquals(file_get_contents(__DIR__.'/schema.yml'), file_get_contents($file));
$this->assertEquals(file_get_contents(__DIR__.'/schema.json'), file_get_contents($file));
}
}
2 changes: 2 additions & 0 deletions Tests/Functional/Relay/Node/GlobalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function testReFetchesTheIds()
id
... on Post {
text
status
}
}
}
Expand All @@ -100,6 +101,7 @@ public function testReFetchesTheIds()
'post' => [
'id' => 'UG9zdDox',
'text' => 'lorem',
'status' => 'DRAFT',
],
];

Expand Down
2 changes: 2 additions & 0 deletions Tests/Functional/app/Resolver/GlobalResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ class GlobalResolver
1 => [
'id' => 1,
'text' => 'lorem',
'status' => 2,
],
2 => [
'id' => 2,
'text' => 'ipsum',
'status' => 1,
],
];

Expand Down
9 changes: 9 additions & 0 deletions Tests/Functional/app/config/global/mapping/global.types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,13 @@ Post:
typeName: Post
text:
type: String
status:
type: Status
interfaces: [NodeInterface]

Status:
type: enum
config:
values:
PUBLISHED: 1
DRAFT: 2