Skip to content

Commit 07b7cec

Browse files
committed
Add lazy loading to test
1 parent 2b218dc commit 07b7cec

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

tests/ObjectTypesUseCaseTest.php

+4
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,16 @@ public function post_type_was_created(): void
4444
*/
4545
public function type_definitions_match(): void
4646
{
47+
$userInput = null;
48+
$postInput = null;
49+
4750
$postInput = new InputObjectType([
4851
'name' => 'PostInput',
4952
'fields' => [
5053
'id' => Type::nonNull(Type::int()),
5154
'title' => Type::nonNull(Type::string()),
5255
'content' => type::nonNull(Type::string()),
56+
'author' => Type::nonNull(fn () => $userInput),
5357
],
5458
]);
5559

tests/TestClasses/Post.php

+2
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ class Post
1111
public string $title;
1212

1313
public string $content;
14+
15+
public User $author;
1416
}

0 commit comments

Comments
 (0)