@@ -12,9 +12,6 @@ |
||
12 | 12 | use Youshido\GraphQL\Config\Schema\SchemaConfig; |
13 | 13 | use Youshido\GraphQL\Execution\ResolveInfo; |
14 | 14 | use Youshido\GraphQL\Schema\AbstractSchema; |
15 | -use Youshido\GraphQL\Type\NonNullType; |
|
16 | -use Youshido\GraphQL\Type\Scalar\IntType; |
|
17 | -use Youshido\GraphQL\Type\Scalar\StringType; |
|
18 | 15 | |
19 | 16 | class TestSchema extends AbstractSchema |
20 | 17 | { |
@@ -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', [ |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | 'args' => [ |
42 | 42 | 'noop' => new IntType() |
43 | 43 | ], |
44 | - 'resolve' => function ($value, $args, $info) { |
|
44 | + 'resolve' => function($value, $args, $info) { |
|
45 | 45 | return ['address' => '1234 Street']; |
46 | 46 | } |
47 | 47 | ] |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 'args' => [ |
53 | 53 | 'value' => new NonNullType(new StringType()) |
54 | 54 | ], |
55 | - 'resolve' => function ($value, $args, $info) { |
|
55 | + 'resolve' => function($value, $args, $info) { |
|
56 | 56 | return $args['value']; |
57 | 57 | } |
58 | 58 | ] |