@@ -151,84 +151,84 @@ discard block |
||
151 | 151 | $this->assertEquals($expectedResponse, $responseData); |
152 | 152 | } |
153 | 153 | |
154 | - public function testCombinedFields() |
|
155 | - { |
|
154 | + public function testCombinedFields() |
|
155 | + { |
|
156 | 156 | $schema = new TestEmptySchema(); |
157 | 157 | |
158 | 158 | $interface = new InterfaceType([ |
159 | - 'name' => 'TestInterface', |
|
160 | - 'fields' => [ |
|
159 | + 'name' => 'TestInterface', |
|
160 | + 'fields' => [ |
|
161 | 161 | 'id' => ['type' => new IntType()], |
162 | 162 | 'name' => ['type' => new IntType()], |
163 | - ], |
|
164 | - 'resolveType' => function ($type) { |
|
163 | + ], |
|
164 | + 'resolveType' => function ($type) { |
|
165 | 165 | |
166 | - } |
|
166 | + } |
|
167 | 167 | ]); |
168 | 168 | |
169 | 169 | $object1 = new ObjectType([ |
170 | - 'name' => 'Test1', |
|
171 | - 'fields' => [ |
|
170 | + 'name' => 'Test1', |
|
171 | + 'fields' => [ |
|
172 | 172 | 'id' => ['type' => new IntType()], |
173 | 173 | 'name' => ['type' => new IntType()], |
174 | 174 | 'lastName' => ['type' => new IntType()], |
175 | - ], |
|
176 | - 'interfaces' => [$interface] |
|
175 | + ], |
|
176 | + 'interfaces' => [$interface] |
|
177 | 177 | ]); |
178 | 178 | |
179 | 179 | $object2 = new ObjectType([ |
180 | - 'name' => 'Test2', |
|
181 | - 'fields' => [ |
|
180 | + 'name' => 'Test2', |
|
181 | + 'fields' => [ |
|
182 | 182 | 'id' => ['type' => new IntType()], |
183 | 183 | 'name' => ['type' => new IntType()], |
184 | 184 | 'thirdName' => ['type' => new IntType()], |
185 | - ], |
|
186 | - 'interfaces' => [$interface] |
|
185 | + ], |
|
186 | + 'interfaces' => [$interface] |
|
187 | 187 | ]); |
188 | 188 | |
189 | 189 | $unionType = new UnionType([ |
190 | - 'name' => 'UnionType', |
|
191 | - 'types' => [$object1, $object2], |
|
192 | - 'resolveType' => function () { |
|
190 | + 'name' => 'UnionType', |
|
191 | + 'types' => [$object1, $object2], |
|
192 | + 'resolveType' => function () { |
|
193 | 193 | |
194 | - } |
|
194 | + } |
|
195 | 195 | ]); |
196 | 196 | |
197 | 197 | $schema->addQueryField(new Field([ |
198 | - 'name' => 'union', |
|
199 | - 'type' => $unionType, |
|
200 | - 'args' => [ |
|
198 | + 'name' => 'union', |
|
199 | + 'type' => $unionType, |
|
200 | + 'args' => [ |
|
201 | 201 | 'id' => ['type' => TypeMap::TYPE_INT] |
202 | - ], |
|
203 | - 'resolve' => function () { |
|
202 | + ], |
|
203 | + 'resolve' => function () { |
|
204 | 204 | return [ |
205 | - 'id' => 1, |
|
206 | - 'name' => 'Alex' |
|
205 | + 'id' => 1, |
|
206 | + 'name' => 'Alex' |
|
207 | 207 | ]; |
208 | - } |
|
208 | + } |
|
209 | 209 | ])); |
210 | 210 | |
211 | 211 | $schema->addMutationField(new Field([ |
212 | - 'name' => 'mutation', |
|
213 | - 'type' => $unionType, |
|
214 | - 'args' => [ |
|
212 | + 'name' => 'mutation', |
|
213 | + 'type' => $unionType, |
|
214 | + 'args' => [ |
|
215 | 215 | 'type' => new EnumType([ |
216 | - 'name' => 'MutationType', |
|
217 | - 'values' => [ |
|
216 | + 'name' => 'MutationType', |
|
217 | + 'values' => [ |
|
218 | 218 | [ |
219 | - 'name' => 'Type1', |
|
220 | - 'value' => 'type_1' |
|
219 | + 'name' => 'Type1', |
|
220 | + 'value' => 'type_1' |
|
221 | 221 | ], |
222 | 222 | [ |
223 | - 'name' => 'Type2', |
|
224 | - 'value' => 'type_2' |
|
223 | + 'name' => 'Type2', |
|
224 | + 'value' => 'type_2' |
|
225 | + ] |
|
225 | 226 | ] |
226 | - ] |
|
227 | 227 | ]) |
228 | - ], |
|
229 | - 'resolve' => function () { |
|
228 | + ], |
|
229 | + 'resolve' => function () { |
|
230 | 230 | return null; |
231 | - } |
|
231 | + } |
|
232 | 232 | ])); |
233 | 233 | |
234 | 234 | $processor = new Processor($schema); |
@@ -238,9 +238,9 @@ discard block |
||
238 | 238 | |
239 | 239 | /** strange that this test got broken after I fixed the field resolve behavior */ |
240 | 240 | $this->assertArrayNotHasKey('errors', $responseData); |
241 | - } |
|
241 | + } |
|
242 | 242 | |
243 | - public function predefinedSchemaProvider() |
|
243 | + public function predefinedSchemaProvider() |
|
244 | 244 | { |
245 | 245 | return [ |
246 | 246 | [ |
@@ -35,8 +35,8 @@ |
||
35 | 35 | |
36 | 36 | public function build(SchemaConfig $config) |
37 | 37 | { |
38 | - $this->addQueryField(new SchemaField()); |
|
39 | - $this->addQueryField(new TypeDefinitionField()); |
|
38 | + $this->addQueryField(new SchemaField()); |
|
39 | + $this->addQueryField(new TypeDefinitionField()); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | public function addQueryField($field, $fieldInfo = null) |