diff --git a/tests/Integration/WhereConditions/WhereHasConditionsDirectiveTest.php b/tests/Integration/WhereConditions/WhereHasConditionsDirectiveTest.php index b89debf9db..552830f41f 100644 --- a/tests/Integration/WhereConditions/WhereHasConditionsDirectiveTest.php +++ b/tests/Integration/WhereConditions/WhereHasConditionsDirectiveTest.php @@ -4,6 +4,7 @@ use Nuwave\Lighthouse\WhereConditions\WhereConditionsServiceProvider; use Tests\DBTestCase; +use Tests\Utils\Models\Post; use Tests\Utils\Models\User; class WhereHasConditionsDirectiveTest extends DBTestCase @@ -170,4 +171,29 @@ public function testOperatorOr(): void ], ]); } + + public function testConditionOnQueriedField() : void { + factory(Post::class)->create(); + + $this->graphQL(/** @lang GraphQL */' + { + posts( + hasUser: { + column: "id" + value: 1 + } + ) { + id + } + } + ')->assertExactJson([ + 'data' => [ + 'posts' => [ + [ + 'id' => '1' + ] + ] + ] + ]); + } }