@@ -9,18 +9,18 @@ describe('jsonToGraphQLQuery() - name', () => {
99 lorem : {
1010 __aliasFor : 'Posts' ,
1111 __args : {
12- arg1 : 20 ,
12+ arg1 : 20
1313 } ,
14- id : true ,
14+ id : true
1515 } ,
1616 larem : {
1717 __aliasFor : 'Posts' ,
1818 __args : {
19- arg2 : 10 ,
19+ arg2 : 10
2020 } ,
21- id : true ,
22- } ,
23- } ,
21+ id : true
22+ }
23+ }
2424 } ;
2525 expect ( jsonToGraphQLQuery ( query ) ) . to . equal (
2626 'query NewName { lorem: Posts (arg1: 20) { id } larem: Posts (arg2: 10) { id } }'
@@ -34,18 +34,18 @@ describe('jsonToGraphQLQuery() - name', () => {
3434 one : {
3535 __aliasFor : 'Posts' ,
3636 __args : {
37- arg1 : 20 ,
37+ arg1 : 20
3838 } ,
39- id : true ,
39+ id : true
4040 } ,
4141 two : {
4242 __aliasFor : 'Posts' ,
4343 __args : {
44- arg2 : 10 ,
44+ arg2 : 10
4545 } ,
46- id : true ,
47- } ,
48- } ,
46+ id : true
47+ }
48+ }
4949 } ;
5050 expect ( jsonToGraphQLQuery ( query ) ) . to . equal (
5151 'mutation NewName { one: Posts (arg1: 20) { id } two: Posts (arg2: 10) { id } }'
@@ -62,12 +62,12 @@ describe('jsonToGraphQLQuery() - combinations', () => {
6262 Posts : {
6363 __args : {
6464 arg1 : 20 ,
65- arg2 : new VariableType ( 'variable1' ) ,
65+ arg2 : new VariableType ( 'variable1' )
6666 } ,
6767 id : true ,
68- title : true ,
69- } ,
70- } ,
68+ title : true
69+ }
70+ }
7171 } ;
7272 expect ( jsonToGraphQLQuery ( query , { pretty : true } ) ) . to . equal (
7373 `query NewName {
@@ -79,24 +79,23 @@ describe('jsonToGraphQLQuery() - combinations', () => {
7979 ) ;
8080 } ) ;
8181
82-
8382 it ( 'correctly converts query with name/variables' , ( ) => {
8483 const query = {
8584 query : {
8685 __name : 'NewName' ,
8786 __variables : {
8887 variable1 : 'String!' ,
89- variableWithDefault : 'String = "default_value"' ,
88+ variableWithDefault : 'String = "default_value"'
9089 } ,
9190 Posts : {
9291 __args : {
9392 arg1 : 20 ,
94- arg2 : new VariableType ( 'variable1' ) ,
93+ arg2 : new VariableType ( 'variable1' )
9594 } ,
9695 id : true ,
97- title : true ,
98- } ,
99- } ,
96+ title : true
97+ }
98+ }
10099 } ;
101100 expect ( jsonToGraphQLQuery ( query , { pretty : true } ) ) . to . equal (
102101 `query NewName ($variable1: String!, $variableWithDefault: String = "default_value") {
@@ -114,65 +113,65 @@ describe('jsonToGraphQLQuery() - combinations', () => {
114113 __name : 'NewName' ,
115114 __variables : {
116115 someString : 'String!' ,
117- varWithDefault : 'String = "default_value"' ,
116+ varWithDefault : 'String = "default_value"'
118117 } ,
119118 one : {
120119 __aliasFor : 'Posts' ,
121120 __args : {
122121 arg1 : 20 ,
123122 arg2 : new VariableType ( 'someString' ) ,
124- status : new EnumType ( 'PUBLISHED' ) ,
123+ status : new EnumType ( 'PUBLISHED' )
125124 } ,
126125 name : false ,
127126 id : true ,
128127 title : true ,
129128 comments : {
130129 __args : {
131- offensiveOnly : true ,
130+ offensiveOnly : true
132131 } ,
133132 id : true ,
134133 comment : true ,
135- user : true ,
136- } ,
134+ user : true
135+ }
137136 } ,
138137 Post : {
139138 __args : {
140139 arg1 : 20 ,
141- arg2 : new VariableType ( 'someString' ) ,
140+ arg2 : new VariableType ( 'someString' )
142141 } ,
143142 __on : {
144143 __typeName : 'ConfigurablePost' ,
145- id : true ,
144+ id : true
146145 } ,
147146 name : false ,
148147 title : true ,
149148 comments : {
150149 __args : {
151- offensiveOnly : true ,
150+ offensiveOnly : true
152151 } ,
153152 id : true ,
154153 comment : true ,
155- user : true ,
156- } ,
154+ user : true
155+ }
157156 } ,
158157 Posts : {
159158 __args : {
160159 arg1 : 20 ,
161- arg2 : new VariableType ( 'someString' ) ,
160+ arg2 : new VariableType ( 'someString' )
162161 } ,
163162 name : false ,
164163 id : true ,
165164 title : true ,
166165 comments : {
167166 __args : {
168- offensiveOnly : true ,
167+ offensiveOnly : true
169168 } ,
170169 id : true ,
171170 comment : true ,
172- user : true ,
173- } ,
174- } ,
175- } ,
171+ user : true
172+ }
173+ }
174+ }
176175 } ;
177176 expect ( jsonToGraphQLQuery ( query , { pretty : true } ) ) . to . equal (
178177 `query NewName ($someString: String!, $varWithDefault: String = "default_value") {
0 commit comments