@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - public function testNestedVariables() { |
|
| 58 | + public function testNestedVariables() { |
|
| 59 | 59 | $processor = new Processor(new TestSchema()); |
| 60 | 60 | $noArgsQuery = '{ me { echo(value:"foo") } }'; |
| 61 | 61 | $expectedData = ['data' => ['me' => ['echo' => 'foo']]]; |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | }'; |
| 82 | 82 | $processor->processPayload($parameterizedQueryQuery, ['value' => 1]); |
| 83 | 83 | $this->assertArrayNotHasKey('errors', $processor->getResponseData()); |
| 84 | - } |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | 86 | public function testListNullResponse() |
| 87 | 87 | { |
@@ -192,19 +192,19 @@ discard block |
||
| 192 | 192 | $this->assertEquals(['data' => ['me' => ['firstName' => 'JOHN']]], $processor->getResponseData()); |
| 193 | 193 | |
| 194 | 194 | $schema->getMutationType() |
| 195 | - ->addField(new Field([ |
|
| 196 | - 'name' => 'increaseCounter', |
|
| 197 | - 'type' => new IntType(), |
|
| 198 | - 'resolve' => function ($value, $args, ResolveInfo $info) { |
|
| 199 | - return $this->_counter += $args['amount']; |
|
| 200 | - }, |
|
| 201 | - 'args' => [ |
|
| 202 | - 'amount' => [ |
|
| 203 | - 'type' => new IntType(), |
|
| 204 | - 'default' => 1 |
|
| 205 | - ] |
|
| 206 | - ] |
|
| 207 | - ]))->addField(new Field([ |
|
| 195 | + ->addField(new Field([ |
|
| 196 | + 'name' => 'increaseCounter', |
|
| 197 | + 'type' => new IntType(), |
|
| 198 | + 'resolve' => function ($value, $args, ResolveInfo $info) { |
|
| 199 | + return $this->_counter += $args['amount']; |
|
| 200 | + }, |
|
| 201 | + 'args' => [ |
|
| 202 | + 'amount' => [ |
|
| 203 | + 'type' => new IntType(), |
|
| 204 | + 'default' => 1 |
|
| 205 | + ] |
|
| 206 | + ] |
|
| 207 | + ]))->addField(new Field([ |
|
| 208 | 208 | 'name' => 'invalidResolveTypeMutation', |
| 209 | 209 | 'type' => new NonNullType(new IntType()), |
| 210 | 210 | 'resolve' => function () { |
@@ -30,21 +30,21 @@ |
||
| 30 | 30 | ], |
| 31 | 31 | ])) |
| 32 | 32 | ->addField('location', [ |
| 33 | - 'type' => new ObjectType( |
|
| 34 | - [ |
|
| 35 | - 'name' => 'Location', |
|
| 36 | - 'fields' => [ |
|
| 37 | - 'address' => new StringType() |
|
| 38 | - ] |
|
| 39 | - ] |
|
| 40 | - ), |
|
| 41 | - 'args' => [ |
|
| 42 | - 'noop' => new IntType() |
|
| 43 | - ], |
|
| 44 | - 'resolve' => function ($value, $args, $info) { |
|
| 45 | - return ['address' => '1234 Street']; |
|
| 46 | - } |
|
| 47 | - ] |
|
| 33 | + 'type' => new ObjectType( |
|
| 34 | + [ |
|
| 35 | + 'name' => 'Location', |
|
| 36 | + 'fields' => [ |
|
| 37 | + 'address' => new StringType() |
|
| 38 | + ] |
|
| 39 | + ] |
|
| 40 | + ), |
|
| 41 | + 'args' => [ |
|
| 42 | + 'noop' => new IntType() |
|
| 43 | + ], |
|
| 44 | + 'resolve' => function ($value, $args, $info) { |
|
| 45 | + return ['address' => '1234 Street']; |
|
| 46 | + } |
|
| 47 | + ] |
|
| 48 | 48 | ) |
| 49 | 49 | ->addField( |
| 50 | 50 | 'echo', [ |