Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
]
]
]
]);
}
}