File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed
Fixtures/Integration/Models Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -36,17 +36,13 @@ public function getPosts(
36
36
return $ prefetchedPosts [$ this ->id ];
37
37
}
38
38
39
- /**
40
- * @param Blog[][] $prefetchedSubBlogs
41
- *
42
- * @return callable(): Blog[]
43
- */
44
- #[Field]
39
+ /** @param Blog[][] $prefetchedSubBlogs */
40
+ #[Field(outputType: '[Blog!]! ' )]
45
41
public function getSubBlogs (
46
42
#[Prefetch('prefetchSubBlogs ' )]
47
43
array $ prefetchedSubBlogs ,
48
- ): callable {
49
- return fn () => $ prefetchedSubBlogs [$ this ->id ];
44
+ ): Deferred {
45
+ return new Deferred ( fn () => $ prefetchedSubBlogs [$ this ->id ]) ;
50
46
}
51
47
52
48
/**
@@ -84,4 +80,10 @@ public static function prefetchSubBlogs(iterable $blogs): array
84
80
85
81
return $ subBlogs ;
86
82
}
83
+
84
+ /** @return callable(): User */
85
+ #[Field]
86
+ public function author (): callable {
87
+ return fn () => new User ('Author ' , 'author@graphqlite ' );
88
+ }
87
89
}
Original file line number Diff line number Diff line change @@ -2359,6 +2359,9 @@ public function testPrefetchingOfSameTypeInDifferentNestingLevels(): void
2359
2359
}
2360
2360
}
2361
2361
}
2362
+ author {
2363
+ email
2364
+ }
2362
2365
posts {
2363
2366
title
2364
2367
comments {
@@ -2399,6 +2402,9 @@ public function testPrefetchingOfSameTypeInDifferentNestingLevels(): void
2399
2402
],
2400
2403
],
2401
2404
],
2405
+ 'author ' => [
2406
+ 'email ' => 'author@graphqlite ' ,
2407
+ ],
2402
2408
'posts ' => [
2403
2409
[
2404
2410
'title ' => 'post-1.1 ' ,
@@ -2435,6 +2441,9 @@ public function testPrefetchingOfSameTypeInDifferentNestingLevels(): void
2435
2441
],
2436
2442
],
2437
2443
],
2444
+ 'author ' => [
2445
+ 'email ' => 'author@graphqlite ' ,
2446
+ ],
2438
2447
'posts ' => [
2439
2448
[
2440
2449
'title ' => 'post-2.1 ' ,
You can’t perform that action at this time.
0 commit comments