File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 4
4
5
5
namespace Overblog \GraphQLBundle \Relay \Connection ;
6
6
7
+ use GraphQL \Executor \Promise \Promise ;
8
+
7
9
interface ConnectionInterface
8
10
{
9
11
/**
@@ -33,14 +35,16 @@ public function getPageInfo(): ?PageInfoInterface;
33
35
public function setPageInfo (PageInfoInterface $ pageInfo ): void ;
34
36
35
37
/**
36
- * Get the total count.
38
+ * Get the total count or promise that returns the total count .
37
39
*
38
- * @return int
40
+ * @return int|Promise|null
39
41
*/
40
- public function getTotalCount (): ? int ;
42
+ public function getTotalCount ();
41
43
42
44
/**
43
- * Set the total count.
45
+ * Set the total count or promise that returns the total count.
46
+ *
47
+ * @param int|Promise $totalCount
44
48
*/
45
- public function setTotalCount (int $ totalCount ): void ;
49
+ public function setTotalCount ($ totalCount ): void ;
46
50
}
Original file line number Diff line number Diff line change 4
4
5
5
namespace Overblog \GraphQLBundle \Relay \Connection \Output ;
6
6
7
+ use GraphQL \Executor \Promise \Promise ;
7
8
use Overblog \GraphQLBundle \Relay \Connection \ConnectionInterface ;
8
9
use Overblog \GraphQLBundle \Relay \Connection \EdgeInterface ;
9
10
use Overblog \GraphQLBundle \Relay \Connection \PageInfoInterface ;
@@ -16,7 +17,9 @@ class Connection implements ConnectionInterface
16
17
protected array $ edges ;
17
18
18
19
protected ?PageInfoInterface $ pageInfo ;
19
- protected ?int $ totalCount = null ;
20
+
21
+ /** @var int|Promise|null Total count or promise that returns the total count */
22
+ protected $ totalCount = null ;
20
23
21
24
public function __construct (array $ edges = [], PageInfoInterface $ pageInfo = null )
22
25
{
@@ -59,15 +62,15 @@ public function setPageInfo(PageInfoInterface $pageInfo): void
59
62
/**
60
63
* {@inheritdoc}
61
64
*/
62
- public function getTotalCount (): ? int
65
+ public function getTotalCount ()
63
66
{
64
67
return $ this ->totalCount ;
65
68
}
66
69
67
70
/**
68
71
* {@inheritdoc}
69
72
*/
70
- public function setTotalCount (int $ totalCount ): void
73
+ public function setTotalCount ($ totalCount ): void
71
74
{
72
75
$ this ->totalCount = $ totalCount ;
73
76
}
You can’t perform that action at this time.
0 commit comments