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
88{
99 public static function toConfig (Node $ node )
1010 {
11- $ config = [
12- 'description ' => DescriptionNode::toConfig ($ node ),
13- ];
14-
1511 $ values = [];
12+
1613 foreach ($ node ->values as $ value ) {
1714 $ values [$ value ->name ->value ] = [
18- 'description ' => DescriptionNode::toConfig ($ node ),
15+ 'description ' => DescriptionNode::toConfig ($ value ),
1916 'value ' => $ value ->name ->value ,
2017 ];
2118
2219 $ directiveConfig = DirectiveNode::toConfig ($ value );
20+
2321 if (isset ($ directiveConfig ['deprecationReason ' ])) {
2422 $ values [$ value ->name ->value ]['deprecationReason ' ] = $ directiveConfig ['deprecationReason ' ];
2523 }
2624 }
27- $ config ['values ' ] = $ values ;
2825
2926 return [
3027 'type ' => 'enum ' ,
31- 'config ' => $ config ,
28+ 'config ' => [
29+ 'description ' => DescriptionNode::toConfig ($ node ),
30+ 'values ' => $ values ,
31+ ],
3232 ];
3333 }
3434}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ type Starship {
1616
1717enum Episode {
1818 NEWHOPE
19+ # Star Wars: Episode V – The Empire Strikes Back
1920 EMPIRE
2021 JEDI @deprecated
2122}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ type Starship {
1616
1717enum Episode {
1818 NEWHOPE
19+ """Star Wars: Episode V – The Empire Strikes Back"""
1920 EMPIRE
2021 JEDI @deprecated
2122}
Original file line number Diff line number Diff line change 5656 'config ' => [
5757 'description ' => null ,
5858 '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+ ],
6167 'JEDI ' => [
6268 'description ' => null ,
6369 'value ' => 'JEDI ' ,
You can’t perform that action at this time.
0 commit comments