|
37 | 37 | use TheCodingMachine\GraphQLite\Fixtures\TestControllerWithParamDateTime;
|
38 | 38 | use TheCodingMachine\GraphQLite\Fixtures\TestControllerWithReturnDateTime;
|
39 | 39 | use TheCodingMachine\GraphQLite\Fixtures\TestControllerWithUnionInputParam;
|
| 40 | +use TheCodingMachine\GraphQLite\Fixtures\TestDeprecatedField; |
40 | 41 | use TheCodingMachine\GraphQLite\Fixtures\TestDoubleReturnTag;
|
41 | 42 | use TheCodingMachine\GraphQLite\Fixtures\TestEnum;
|
42 | 43 | use TheCodingMachine\GraphQLite\Fixtures\TestFieldBadInputType;
|
43 | 44 | use TheCodingMachine\GraphQLite\Fixtures\TestFieldBadOutputType;
|
44 | 45 | use TheCodingMachine\GraphQLite\Fixtures\TestObject;
|
| 46 | +use TheCodingMachine\GraphQLite\Fixtures\TestObjectWithDeprecatedField; |
45 | 47 | use TheCodingMachine\GraphQLite\Fixtures\TestSelfType;
|
46 | 48 | use TheCodingMachine\GraphQLite\Fixtures\TestSourceFieldBadOutputType;
|
47 | 49 | use TheCodingMachine\GraphQLite\Fixtures\TestSourceFieldBadOutputType2;
|
@@ -922,4 +924,20 @@ public function testSourceNameInSourceAndMagicFields(): void
|
922 | 924 | $result = $resolve($source, [], null, $this->createMock(ResolveInfo::class));
|
923 | 925 | $this->assertSame('bar value', $result);
|
924 | 926 | }
|
| 927 | + |
| 928 | + public function testDeprecationInDocblock(): void |
| 929 | + { |
| 930 | + $fieldsBuilder = $this->buildFieldsBuilder(); |
| 931 | + $inputFields = $fieldsBuilder->getFields( |
| 932 | + new TestDeprecatedField(), |
| 933 | + 'Test', |
| 934 | + ); |
| 935 | + |
| 936 | + $this->assertCount(2, $inputFields); |
| 937 | + |
| 938 | + $this->assertEquals('this is deprecated', $inputFields['deprecatedField']->deprecationReason); |
| 939 | + $this->assertTrue( $inputFields['deprecatedField']->isDeprecated()); |
| 940 | + $this->assertNull( $inputFields['name']->deprecationReason); |
| 941 | + $this->assertFalse( $inputFields['name']->isDeprecated()); |
| 942 | + } |
925 | 943 | }
|
0 commit comments