From bc6aa4e5e76c146293bd35acb50f6493b2a23c75 Mon Sep 17 00:00:00 2001 From: Aleksei Lebedev <1329824+LastDragon-ru@users.noreply.github.com> Date: Wed, 18 Oct 2023 10:20:35 +0400 Subject: [PATCH] Tests fixes. --- .../src/Stream/Directives/DirectiveTest.php | 10 +++- .../Directives/DirectiveTest~expected.graphql | 48 ------------------- 2 files changed, 9 insertions(+), 49 deletions(-) diff --git a/packages/graphql/src/Stream/Directives/DirectiveTest.php b/packages/graphql/src/Stream/Directives/DirectiveTest.php index 96fe2c116..058314169 100644 --- a/packages/graphql/src/Stream/Directives/DirectiveTest.php +++ b/packages/graphql/src/Stream/Directives/DirectiveTest.php @@ -23,6 +23,9 @@ use LastDragon_ru\LaraASP\GraphQL\Builder\Sources\ObjectFieldSource; use LastDragon_ru\LaraASP\GraphQL\Builder\Sources\ObjectSource; use LastDragon_ru\LaraASP\GraphQL\Exceptions\ArgumentAlreadyDefined; +use LastDragon_ru\LaraASP\GraphQL\Package; +use LastDragon_ru\LaraASP\GraphQL\SearchBy\Definitions\SearchByOperatorEqualDirective; +use LastDragon_ru\LaraASP\GraphQL\SearchBy\Operators; use LastDragon_ru\LaraASP\GraphQL\Stream\Contracts\FieldArgumentDirective; use LastDragon_ru\LaraASP\GraphQL\Stream\Contracts\StreamFactory; use LastDragon_ru\LaraASP\GraphQL\Stream\Cursor as StreamCursor; @@ -285,9 +288,14 @@ public function decryptString(mixed $payload): string { public function testManipulateFieldDefinition(): void { config([ - 'lighthouse.namespaces.models' => [ + 'lighthouse.namespaces.models' => [ (new ReflectionClass(TestObject::class))->getNamespaceName(), ], + Package::Name.'.search_by.operators' => [ + Operators::ID => [ + SearchByOperatorEqualDirective::class, + ], + ], ]); $directives = $this->app->make(DirectiveLocator::class); diff --git a/packages/graphql/src/Stream/Directives/DirectiveTest~expected.graphql b/packages/graphql/src/Stream/Directives/DirectiveTest~expected.graphql index 6f53fefd4..290c29589 100644 --- a/packages/graphql/src/Stream/Directives/DirectiveTest~expected.graphql +++ b/packages/graphql/src/Stream/Directives/DirectiveTest~expected.graphql @@ -23,30 +23,12 @@ on | INPUT_FIELD_DEFINITION | SCALAR -directive @searchByOperatorIn -on - | ENUM - | INPUT_FIELD_DEFINITION - | SCALAR - directive @searchByOperatorNot on | ENUM | INPUT_FIELD_DEFINITION | SCALAR -directive @searchByOperatorNotEqual -on - | ENUM - | INPUT_FIELD_DEFINITION - | SCALAR - -directive @searchByOperatorNotIn -on - | ENUM - | INPUT_FIELD_DEFINITION - | SCALAR - directive @searchByOperatorProperty on | ENUM @@ -160,24 +142,6 @@ input SearchByScalarID { """ equal: ID @searchByOperatorEqual - - """ - Within a set of values. - """ - in: [ID!] - @searchByOperatorIn - - """ - Not Equal (`!=`). - """ - notEqual: ID - @searchByOperatorNotEqual - - """ - Outside a set of values. - """ - notIn: [ID!] - @searchByOperatorNotIn } """ @@ -206,18 +170,6 @@ input SearchByScoutScalarID { """ equal: ID @searchByOperatorEqual - - """ - Within a set of values. - """ - in: [ID!] - @searchByOperatorIn - - """ - Outside a set of values. - """ - notIn: [ID!] - @searchByOperatorNotIn } """