Skip to content

Commit af27e6a

Browse files
committed
Add property flag to control if the GraphQL query should include the property
1 parent f99a19e commit af27e6a

File tree

3 files changed

+414
-50
lines changed

3 files changed

+414
-50
lines changed

infrahub_sdk/client.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ async def get(
333333
populate_store: bool = ...,
334334
fragment: bool = ...,
335335
prefetch_relationships: bool = ...,
336+
property: bool = ...,
336337
**kwargs: Any,
337338
) -> Optional[SchemaType]: ...
338339

@@ -351,6 +352,7 @@ async def get(
351352
populate_store: bool = ...,
352353
fragment: bool = ...,
353354
prefetch_relationships: bool = ...,
355+
property: bool = ...,
354356
**kwargs: Any,
355357
) -> SchemaType: ...
356358

@@ -369,6 +371,7 @@ async def get(
369371
populate_store: bool = ...,
370372
fragment: bool = ...,
371373
prefetch_relationships: bool = ...,
374+
property: bool = ...,
372375
**kwargs: Any,
373376
) -> SchemaType: ...
374377

@@ -387,6 +390,7 @@ async def get(
387390
populate_store: bool = ...,
388391
fragment: bool = ...,
389392
prefetch_relationships: bool = ...,
393+
property: bool = ...,
390394
**kwargs: Any,
391395
) -> Optional[InfrahubNode]: ...
392396

@@ -405,6 +409,7 @@ async def get(
405409
populate_store: bool = ...,
406410
fragment: bool = ...,
407411
prefetch_relationships: bool = ...,
412+
property: bool = ...,
408413
**kwargs: Any,
409414
) -> InfrahubNode: ...
410415

@@ -423,6 +428,7 @@ async def get(
423428
populate_store: bool = ...,
424429
fragment: bool = ...,
425430
prefetch_relationships: bool = ...,
431+
property: bool = ...,
426432
**kwargs: Any,
427433
) -> InfrahubNode: ...
428434

@@ -440,6 +446,7 @@ async def get(
440446
populate_store: bool = False,
441447
fragment: bool = False,
442448
prefetch_relationships: bool = False,
449+
property: bool = False,
443450
**kwargs: Any,
444451
) -> Union[InfrahubNode, SchemaType, None]:
445452
branch = branch or self.default_branch
@@ -472,6 +479,7 @@ async def get(
472479
exclude=exclude,
473480
fragment=fragment,
474481
prefetch_relationships=prefetch_relationships,
482+
property=property,
475483
**filters,
476484
)
477485

@@ -535,6 +543,7 @@ async def all(
535543
exclude: Optional[list[str]] = ...,
536544
fragment: bool = ...,
537545
prefetch_relationships: bool = ...,
546+
property: bool = ...,
538547
) -> list[SchemaType]: ...
539548

540549
@overload
@@ -551,6 +560,7 @@ async def all(
551560
exclude: Optional[list[str]] = ...,
552561
fragment: bool = ...,
553562
prefetch_relationships: bool = ...,
563+
property: bool = ...,
554564
) -> list[InfrahubNode]: ...
555565

556566
async def all(
@@ -566,6 +576,7 @@ async def all(
566576
exclude: Optional[list[str]] = None,
567577
fragment: bool = False,
568578
prefetch_relationships: bool = False,
579+
property: bool = False,
569580
) -> Union[list[InfrahubNode], list[SchemaType]]:
570581
"""Retrieve all nodes of a given kind
571582
@@ -597,6 +608,7 @@ async def all(
597608
exclude=exclude,
598609
fragment=fragment,
599610
prefetch_relationships=prefetch_relationships,
611+
property=property,
600612
)
601613

602614
@overload
@@ -614,6 +626,7 @@ async def filters(
614626
fragment: bool = ...,
615627
prefetch_relationships: bool = ...,
616628
partial_match: bool = ...,
629+
property: bool = ...,
617630
**kwargs: Any,
618631
) -> list[SchemaType]: ...
619632

@@ -632,6 +645,7 @@ async def filters(
632645
fragment: bool = ...,
633646
prefetch_relationships: bool = ...,
634647
partial_match: bool = ...,
648+
property: bool = ...,
635649
**kwargs: Any,
636650
) -> list[InfrahubNode]: ...
637651

@@ -649,6 +663,7 @@ async def filters(
649663
fragment: bool = False,
650664
prefetch_relationships: bool = False,
651665
partial_match: bool = False,
666+
property: bool = False,
652667
**kwargs: Any,
653668
) -> Union[list[InfrahubNode], list[SchemaType]]:
654669
"""Retrieve nodes of a given kind based on provided filters.
@@ -698,6 +713,7 @@ async def filters(
698713
fragment=fragment,
699714
prefetch_relationships=prefetch_relationships,
700715
partial_match=partial_match,
716+
# property=property,
701717
)
702718
query = Query(query=query_data)
703719
response = await self.execute_graphql(
@@ -1551,6 +1567,7 @@ def all(
15511567
exclude: Optional[list[str]] = ...,
15521568
fragment: bool = ...,
15531569
prefetch_relationships: bool = ...,
1570+
property: bool = ...,
15541571
) -> list[SchemaTypeSync]: ...
15551572

15561573
@overload
@@ -1567,6 +1584,7 @@ def all(
15671584
exclude: Optional[list[str]] = ...,
15681585
fragment: bool = ...,
15691586
prefetch_relationships: bool = ...,
1587+
property: bool = ...,
15701588
) -> list[InfrahubNodeSync]: ...
15711589

15721590
def all(
@@ -1582,6 +1600,7 @@ def all(
15821600
exclude: Optional[list[str]] = None,
15831601
fragment: bool = False,
15841602
prefetch_relationships: bool = False,
1603+
property: bool = False,
15851604
) -> Union[list[InfrahubNodeSync], list[SchemaTypeSync]]:
15861605
"""Retrieve all nodes of a given kind
15871606
@@ -1613,6 +1632,7 @@ def all(
16131632
exclude=exclude,
16141633
fragment=fragment,
16151634
prefetch_relationships=prefetch_relationships,
1635+
property=property,
16161636
)
16171637

16181638
def _process_nodes_and_relationships(
@@ -1665,6 +1685,7 @@ def filters(
16651685
fragment: bool = ...,
16661686
prefetch_relationships: bool = ...,
16671687
partial_match: bool = ...,
1688+
property: bool = ...,
16681689
**kwargs: Any,
16691690
) -> list[SchemaTypeSync]: ...
16701691

@@ -1683,6 +1704,7 @@ def filters(
16831704
fragment: bool = ...,
16841705
prefetch_relationships: bool = ...,
16851706
partial_match: bool = ...,
1707+
property: bool = ...,
16861708
**kwargs: Any,
16871709
) -> list[InfrahubNodeSync]: ...
16881710

@@ -1700,6 +1722,7 @@ def filters(
17001722
fragment: bool = False,
17011723
prefetch_relationships: bool = False,
17021724
partial_match: bool = False,
1725+
property: bool = False,
17031726
**kwargs: Any,
17041727
) -> Union[list[InfrahubNodeSync], list[SchemaTypeSync]]:
17051728
"""Retrieve nodes of a given kind based on provided filters.
@@ -1749,6 +1772,7 @@ def filters(
17491772
fragment=fragment,
17501773
prefetch_relationships=prefetch_relationships,
17511774
partial_match=partial_match,
1775+
property=property,
17521776
)
17531777
query = Query(query=query_data)
17541778
response = self.execute_graphql(
@@ -1801,6 +1825,7 @@ def get(
18011825
populate_store: bool = ...,
18021826
fragment: bool = ...,
18031827
prefetch_relationships: bool = ...,
1828+
property: bool = ...,
18041829
**kwargs: Any,
18051830
) -> Optional[SchemaTypeSync]: ...
18061831

@@ -1819,6 +1844,7 @@ def get(
18191844
populate_store: bool = ...,
18201845
fragment: bool = ...,
18211846
prefetch_relationships: bool = ...,
1847+
property: bool = ...,
18221848
**kwargs: Any,
18231849
) -> SchemaTypeSync: ...
18241850

@@ -1837,6 +1863,7 @@ def get(
18371863
populate_store: bool = ...,
18381864
fragment: bool = ...,
18391865
prefetch_relationships: bool = ...,
1866+
property: bool = ...,
18401867
**kwargs: Any,
18411868
) -> SchemaTypeSync: ...
18421869

@@ -1855,6 +1882,7 @@ def get(
18551882
populate_store: bool = ...,
18561883
fragment: bool = ...,
18571884
prefetch_relationships: bool = ...,
1885+
property: bool = ...,
18581886
**kwargs: Any,
18591887
) -> Optional[InfrahubNodeSync]: ...
18601888

@@ -1873,6 +1901,7 @@ def get(
18731901
populate_store: bool = ...,
18741902
fragment: bool = ...,
18751903
prefetch_relationships: bool = ...,
1904+
property: bool = ...,
18761905
**kwargs: Any,
18771906
) -> InfrahubNodeSync: ...
18781907

@@ -1891,6 +1920,7 @@ def get(
18911920
populate_store: bool = ...,
18921921
fragment: bool = ...,
18931922
prefetch_relationships: bool = ...,
1923+
property: bool = ...,
18941924
**kwargs: Any,
18951925
) -> InfrahubNodeSync: ...
18961926

@@ -1908,6 +1938,7 @@ def get(
19081938
populate_store: bool = False,
19091939
fragment: bool = False,
19101940
prefetch_relationships: bool = False,
1941+
property: bool = False,
19111942
**kwargs: Any,
19121943
) -> Union[InfrahubNodeSync, SchemaTypeSync, None]:
19131944
branch = branch or self.default_branch
@@ -1940,6 +1971,7 @@ def get(
19401971
exclude=exclude,
19411972
fragment=fragment,
19421973
prefetch_relationships=prefetch_relationships,
1974+
property=property,
19431975
**filters,
19441976
)
19451977

0 commit comments

Comments
 (0)