5151from .schema import InfrahubSchema , InfrahubSchemaSync , NodeSchemaAPI
5252from .store import NodeStore , NodeStoreSync
5353from .timestamp import Timestamp
54- from .types import AsyncRequester , HTTPMethod , SyncRequester
54+ from .types import AsyncRequester , HTTPMethod , Order , SyncRequester
5555from .utils import decode_json , get_user_permissions , is_valid_uuid
5656
5757if TYPE_CHECKING :
@@ -576,6 +576,7 @@ async def all(
576576 prefetch_relationships : bool = ...,
577577 property : bool = ...,
578578 parallel : bool = ...,
579+ order : Order | None = ...,
579580 ) -> list [SchemaType ]: ...
580581
581582 @overload
@@ -594,6 +595,7 @@ async def all(
594595 prefetch_relationships : bool = ...,
595596 property : bool = ...,
596597 parallel : bool = ...,
598+ order : Order | None = ...,
597599 ) -> list [InfrahubNode ]: ...
598600
599601 async def all (
@@ -611,6 +613,7 @@ async def all(
611613 prefetch_relationships : bool = False ,
612614 property : bool = False ,
613615 parallel : bool = False ,
616+ order : Order | None = None ,
614617 ) -> list [InfrahubNode ] | list [SchemaType ]:
615618 """Retrieve all nodes of a given kind
616619
@@ -627,6 +630,7 @@ async def all(
627630 fragment (bool, optional): Flag to use GraphQL fragments for generic schemas.
628631 prefetch_relationships (bool, optional): Flag to indicate whether to prefetch related node data.
629632 parallel (bool, optional): Whether to use parallel processing for the query.
633+ order (Order, optional): Ordering related options. Setting `disable=True` enhances performances.
630634
631635 Returns:
632636 list[InfrahubNode]: List of Nodes
@@ -645,6 +649,7 @@ async def all(
645649 prefetch_relationships = prefetch_relationships ,
646650 property = property ,
647651 parallel = parallel ,
652+ order = order ,
648653 )
649654
650655 @overload
@@ -664,6 +669,7 @@ async def filters(
664669 partial_match : bool = ...,
665670 property : bool = ...,
666671 parallel : bool = ...,
672+ order : Order | None = ...,
667673 ** kwargs : Any ,
668674 ) -> list [SchemaType ]: ...
669675
@@ -684,6 +690,7 @@ async def filters(
684690 partial_match : bool = ...,
685691 property : bool = ...,
686692 parallel : bool = ...,
693+ order : Order | None = ...,
687694 ** kwargs : Any ,
688695 ) -> list [InfrahubNode ]: ...
689696
@@ -703,6 +710,7 @@ async def filters(
703710 partial_match : bool = False ,
704711 property : bool = False ,
705712 parallel : bool = False ,
713+ order : Order | None = None ,
706714 ** kwargs : Any ,
707715 ) -> list [InfrahubNode ] | list [SchemaType ]:
708716 """Retrieve nodes of a given kind based on provided filters.
@@ -721,6 +729,7 @@ async def filters(
721729 prefetch_relationships (bool, optional): Flag to indicate whether to prefetch related node data.
722730 partial_match (bool, optional): Allow partial match of filter criteria for the query.
723731 parallel (bool, optional): Whether to use parallel processing for the query.
732+ order (Order, optional): Ordering related options. Setting `disable=True` enhances performances.
724733 **kwargs (Any): Additional filter criteria for the query.
725734
726735 Returns:
@@ -747,6 +756,7 @@ async def process_page(page_offset: int, page_number: int) -> tuple[dict, Proces
747756 prefetch_relationships = prefetch_relationships ,
748757 partial_match = partial_match ,
749758 property = property ,
759+ order = order ,
750760 )
751761 query = Query (query = query_data )
752762 response = await self .execute_graphql (
@@ -1670,6 +1680,7 @@ def all(
16701680 prefetch_relationships : bool = ...,
16711681 property : bool = ...,
16721682 parallel : bool = ...,
1683+ order : Order | None = ...,
16731684 ) -> list [SchemaTypeSync ]: ...
16741685
16751686 @overload
@@ -1688,6 +1699,7 @@ def all(
16881699 prefetch_relationships : bool = ...,
16891700 property : bool = ...,
16901701 parallel : bool = ...,
1702+ order : Order | None = ...,
16911703 ) -> list [InfrahubNodeSync ]: ...
16921704
16931705 def all (
@@ -1705,6 +1717,7 @@ def all(
17051717 prefetch_relationships : bool = False ,
17061718 property : bool = False ,
17071719 parallel : bool = False ,
1720+ order : Order | None = None ,
17081721 ) -> list [InfrahubNodeSync ] | list [SchemaTypeSync ]:
17091722 """Retrieve all nodes of a given kind
17101723
@@ -1721,6 +1734,7 @@ def all(
17211734 fragment (bool, optional): Flag to use GraphQL fragments for generic schemas.
17221735 prefetch_relationships (bool, optional): Flag to indicate whether to prefetch related node data.
17231736 parallel (bool, optional): Whether to use parallel processing for the query.
1737+ order (Order, optional): Ordering related options. Setting `disable=True` enhances performances.
17241738
17251739 Returns:
17261740 list[InfrahubNodeSync]: List of Nodes
@@ -1739,6 +1753,7 @@ def all(
17391753 prefetch_relationships = prefetch_relationships ,
17401754 property = property ,
17411755 parallel = parallel ,
1756+ order = order ,
17421757 )
17431758
17441759 def _process_nodes_and_relationships (
@@ -1793,6 +1808,7 @@ def filters(
17931808 partial_match : bool = ...,
17941809 property : bool = ...,
17951810 parallel : bool = ...,
1811+ order : Order | None = ...,
17961812 ** kwargs : Any ,
17971813 ) -> list [SchemaTypeSync ]: ...
17981814
@@ -1813,6 +1829,7 @@ def filters(
18131829 partial_match : bool = ...,
18141830 property : bool = ...,
18151831 parallel : bool = ...,
1832+ order : Order | None = ...,
18161833 ** kwargs : Any ,
18171834 ) -> list [InfrahubNodeSync ]: ...
18181835
@@ -1832,6 +1849,7 @@ def filters(
18321849 partial_match : bool = False ,
18331850 property : bool = False ,
18341851 parallel : bool = False ,
1852+ order : Order | None = None ,
18351853 ** kwargs : Any ,
18361854 ) -> list [InfrahubNodeSync ] | list [SchemaTypeSync ]:
18371855 """Retrieve nodes of a given kind based on provided filters.
@@ -1850,6 +1868,7 @@ def filters(
18501868 prefetch_relationships (bool, optional): Flag to indicate whether to prefetch related node data.
18511869 partial_match (bool, optional): Allow partial match of filter criteria for the query.
18521870 parallel (bool, optional): Whether to use parallel processing for the query.
1871+ order (Order, optional): Ordering related options. Setting `disable=True` enhances performances.
18531872 **kwargs (Any): Additional filter criteria for the query.
18541873
18551874 Returns:
@@ -1875,6 +1894,7 @@ def process_page(page_offset: int, page_number: int) -> tuple[dict, ProcessRelat
18751894 prefetch_relationships = prefetch_relationships ,
18761895 partial_match = partial_match ,
18771896 property = property ,
1897+ order = order ,
18781898 )
18791899 query = Query (query = query_data )
18801900 response = self .execute_graphql (
0 commit comments