Skip to content

Commit 2377b99

Browse files
author
Jeremiah VALERIE
committed
Remove XML type config support
1 parent 941238c commit 2377b99

File tree

12 files changed

+29
-112
lines changed

12 files changed

+29
-112
lines changed

UPGRADE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ UPGRADE FROM 0.13 to 0.14
1414
- [Rename `ResolverInterface` to `QueryInterface`](#rename-resolverinterface-to-queryinterface)
1515
- [Remove Argument deprecated method](#remove-argument-deprecated-method)
1616
- [Remove ConnectionBuilder deprecated class](#remove-connectionbuilder-deprecated-class)
17+
- [Remove XML type configuration](#remove-xml-type-configuration-support)
1718

1819
### Customize the cursor encoder of the edges of a connection
1920

@@ -216,6 +217,10 @@ Method `Overblog\GraphQLBundle\Definition\Argument::getRawArguments` is replaced
216217
Class `Overblog\GraphQLBundle\Relay\Connection\Output\ConnectionBuilder` is replaced by
217218
`Overblog\GraphQLBundle\Relay\Connection\ConnectionBuilder`.
218219

220+
### Remove XML type configuration support
221+
222+
XML type configuration is no longer supported.
223+
219224
UPGRADE FROM 0.12 to 0.13
220225
=======================
221226

docs/definitions/type-system/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Types can be define 3 different ways:
88

99
1. **The configuration way**
1010

11-
Creating this file extension **.types.yml** or **.types.xml**
11+
Creating this file extension **.types.yml**
1212
in `src/*Bundle/Resources/config/graphql` or `app/config/graphql`.
1313
See the different possible types:
1414
* [Scalars](scalars.md)
@@ -28,7 +28,7 @@ Types can be define 3 different ways:
2828
# auto_discover: false # to disable bundles and root dir auto discover
2929
types:
3030
-
31-
type: yaml # or xml or graphql or annotation null
31+
type: yaml # or graphql or annotation null
3232
dir: "%kernel.root_dir%/.../mapping" # sub directories are also searched
3333
# suffix: .types # use to change default file suffix
3434
-

src/Config/Parser/XmlParser.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/DependencyInjection/Compiler/ConfigParserPass.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use Overblog\GraphQLBundle\Config\Parser\AttributeParser;
1010
use Overblog\GraphQLBundle\Config\Parser\GraphQLParser;
1111
use Overblog\GraphQLBundle\Config\Parser\PreParserInterface;
12-
use Overblog\GraphQLBundle\Config\Parser\XmlParser;
1312
use Overblog\GraphQLBundle\Config\Parser\YamlParser;
1413
use Overblog\GraphQLBundle\DependencyInjection\TypesConfiguration;
1514
use Overblog\GraphQLBundle\OverblogGraphQLBundle;
@@ -39,15 +38,13 @@ class ConfigParserPass implements CompilerPassInterface
3938
{
4039
public const SUPPORTED_TYPES_EXTENSIONS = [
4140
'yaml' => '{yaml,yml}',
42-
'xml' => 'xml',
4341
'graphql' => '{graphql,graphqls}',
4442
'annotation' => 'php',
4543
'attribute' => 'php',
4644
];
4745

4846
public const PARSERS = [
4947
'yaml' => YamlParser::class,
50-
'xml' => XmlParser::class,
5148
'graphql' => GraphQLParser::class,
5249
'annotation' => AnnotationParser::class,
5350
'attribute' => AttributeParser::class,
@@ -224,7 +221,7 @@ private function mappingFromBundles(ContainerBuilder $container): array
224221

225222
$bundleDir = $this->bundleDir($class);
226223

227-
// only config files (yml or xml)
224+
// only config files (yml)
228225
$typesMappings[] = ['dir' => $bundleDir.'/Resources/config/graphql', 'types' => null];
229226
}
230227

tests/DependencyInjection/Compiler/ConfigParserPassTest.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,6 @@ public function testBrokenYmlOnPrepend(): void
4949
$this->processCompilerPass($this->getMappingConfig('yaml'));
5050
}
5151

52-
public function testBrokenXmlOnPrepend(): void
53-
{
54-
$this->expectException(InvalidArgumentException::class);
55-
$this->expectExceptionMessageMatches('#Unable to parse file "(.*)'.preg_quote(DIRECTORY_SEPARATOR).'broken.types.xml"\.#');
56-
$this->processCompilerPass($this->getMappingConfig('xml'));
57-
}
58-
5952
public function testPreparseOnPrepend(): void
6053
{
6154
$this->expectException(InvalidConfigurationException::class);

tests/DependencyInjection/mapping/xml/broken.types.xml

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/Functional/App/config/plural/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ overblog_graphql:
1616
mappings:
1717
types:
1818
-
19-
type: xml
19+
type: yaml
2020
dir: "%kernel.project_dir%/config/plural/mapping"

tests/Functional/App/config/plural/mapping/Query.types.xml

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Query:
2+
type: object
3+
config:
4+
fields:
5+
usernames:
6+
builder: Relay::PluralIdentifyingRoot
7+
builderConfig:
8+
argName: usernames
9+
description: Map from a username to the user
10+
inputType: String
11+
outputType: User
12+
resolveSingleInput: '@=query("plural_resolver", value, info)'

tests/Functional/App/config/plural/mapping/User.types.xml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)