File tree Expand file tree Collapse file tree 4 files changed +17
-9
lines changed
src/Config/Parser/GraphQL/ASTConverter
tests/Config/Parser/fixtures/graphql Expand file tree Collapse file tree 4 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -8,27 +8,27 @@ class EnumNode implements NodeInterface
8
8
{
9
9
public static function toConfig (Node $ node )
10
10
{
11
- $ config = [
12
- 'description ' => DescriptionNode::toConfig ($ node ),
13
- ];
14
-
15
11
$ values = [];
12
+
16
13
foreach ($ node ->values as $ value ) {
17
14
$ values [$ value ->name ->value ] = [
18
- 'description ' => DescriptionNode::toConfig ($ node ),
15
+ 'description ' => DescriptionNode::toConfig ($ value ),
19
16
'value ' => $ value ->name ->value ,
20
17
];
21
18
22
19
$ directiveConfig = DirectiveNode::toConfig ($ value );
20
+
23
21
if (isset ($ directiveConfig ['deprecationReason ' ])) {
24
22
$ values [$ value ->name ->value ]['deprecationReason ' ] = $ directiveConfig ['deprecationReason ' ];
25
23
}
26
24
}
27
- $ config ['values ' ] = $ values ;
28
25
29
26
return [
30
27
'type ' => 'enum ' ,
31
- 'config ' => $ config ,
28
+ 'config ' => [
29
+ 'description ' => DescriptionNode::toConfig ($ node ),
30
+ 'values ' => $ values ,
31
+ ],
32
32
];
33
33
}
34
34
}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ type Starship {
16
16
17
17
enum Episode {
18
18
NEWHOPE
19
+ # Star Wars: Episode V – The Empire Strikes Back
19
20
EMPIRE
20
21
JEDI @deprecated
21
22
}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ type Starship {
16
16
17
17
enum Episode {
18
18
NEWHOPE
19
+ """Star Wars: Episode V – The Empire Strikes Back"""
19
20
EMPIRE
20
21
JEDI @deprecated
21
22
}
Original file line number Diff line number Diff line change 56
56
'config ' => [
57
57
'description ' => null ,
58
58
'values ' => [
59
- 'NEWHOPE ' => ['description ' => null , 'value ' => 'NEWHOPE ' ],
60
- 'EMPIRE ' => ['description ' => null , 'value ' => 'EMPIRE ' ],
59
+ 'NEWHOPE ' => [
60
+ 'description ' => null ,
61
+ 'value ' => 'NEWHOPE ' ,
62
+ ],
63
+ 'EMPIRE ' => [
64
+ 'description ' => 'Star Wars: Episode V – The Empire Strikes Back ' ,
65
+ 'value ' => 'EMPIRE ' ,
66
+ ],
61
67
'JEDI ' => [
62
68
'description ' => null ,
63
69
'value ' => 'JEDI ' ,
You can’t perform that action at this time.
0 commit comments