@@ -547,16 +547,21 @@ async def count(
547547 at : Timestamp | None = None ,
548548 branch : str | None = None ,
549549 timeout : int | None = None ,
550+ ** kwargs : Any ,
550551 ) -> int :
551552 """Return the number of nodes of a given kind."""
553+ filters = kwargs
552554 schema = await self .schema .get (kind = kind , branch = branch )
553555
554556 branch = branch or self .default_branch
555557 if at :
556558 at = Timestamp (at )
557559
558560 response = await self .execute_graphql (
559- query = Query (query = {schema .kind : {"count" : None }}).render (), branch_name = branch , at = at , timeout = timeout
561+ query = Query (query = {schema .kind : {"count" : None , "@filters" : filters }}).render (),
562+ branch_name = branch ,
563+ at = at ,
564+ timeout = timeout ,
560565 )
561566 return int (response .get (schema .kind , {}).get ("count" , 0 ))
562567
@@ -1651,16 +1656,21 @@ def count(
16511656 at : Timestamp | None = None ,
16521657 branch : str | None = None ,
16531658 timeout : int | None = None ,
1659+ ** kwargs : Any ,
16541660 ) -> int :
16551661 """Return the number of nodes of a given kind."""
1662+ filters = kwargs
16561663 schema = self .schema .get (kind = kind , branch = branch )
16571664
16581665 branch = branch or self .default_branch
16591666 if at :
16601667 at = Timestamp (at )
16611668
16621669 response = self .execute_graphql (
1663- query = Query (query = {schema .kind : {"count" : None }}).render (), branch_name = branch , at = at , timeout = timeout
1670+ query = Query (query = {schema .kind : {"count" : None , "@filters" : filters }}).render (),
1671+ branch_name = branch ,
1672+ at = at ,
1673+ timeout = timeout ,
16641674 )
16651675 return int (response .get (schema .kind , {}).get ("count" , 0 ))
16661676
0 commit comments