bootgraph 1.9.0.dev24129__tar.gz → 1.9.0.dev24167__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: bootgraph
3
- Version: 1.9.0.dev24129
3
+ Version: 1.9.0.dev24167
4
4
  Summary: A Python library for integrating SQLModel and Strawberry, providing a seamless GraphQL integration with FastAPI and advanced features for database interactions.
5
5
  Home-page: https://github.com/MDoreto/graphemy
6
6
  License: MIT
@@ -44,6 +44,7 @@ class Graphemy(SQLModel):
44
44
  specific mutation names to their respective permission classes. This allows
45
45
  for fine-grained control over which permissions apply to each mutation. If a
46
46
  mutation is not listed, it defaults to having no specific permissions.
47
+ __default_order_by__ (str): Order by for database queries
47
48
  Classes:
48
49
  Graphemy: An extended SQLModel that incorporates GraphQL functionalities by using
49
50
  Strawberry GraphQL. This class allows defining GraphQL schemas, query names,
@@ -66,6 +67,7 @@ class Graphemy(SQLModel):
66
67
  __enable_query__: bool | None = None
67
68
  __queryname__: str = ""
68
69
  __enginename__: str = "default"
70
+ __default_order_by__: str = "id"
69
71
  __filter_attributes__: Optional[dict[str, dict[str, Any]]] = None
70
72
  __custom_resolvers__: Optional[list[Callable]] = None
71
73
  __custom_mutations__: Optional[list[Callable]] = None
@@ -759,28 +759,6 @@ def get_query(cls: "Graphemy"):
759
759
  return ModelQuery, Filter
760
760
 
761
761
 
762
- def get_put_mutation(cls: "Graphemy") -> StrawberryField:
763
- pk = [pk.name for pk in inspect(cls).primary_key]
764
-
765
- class Filter:
766
- pass
767
-
768
- for field_name, field in cls.__annotations__.items():
769
- setattr(
770
- Filter,
771
- field_name,
772
- strawberry.field(default=None, graphql_type=Optional[field]),
773
- )
774
- input = strawberry.input(name=f"{cls.__name__}Input")(Filter)
775
-
776
- async def mutation(self, params: input) -> cls.__strawberry_schema__:
777
- return await put_item(cls, params, pk)
778
-
779
- return strawberry.mutation(
780
- mutation,
781
- permission_classes=[Setup.get_auth(cls, "mutation")],
782
- )
783
-
784
762
 
785
763
  def get_delete_mutation(cls: "Graphemy") -> StrawberryField:
786
764
  pk = [pk.name for pk in inspect(cls).primary_key]
@@ -911,6 +889,10 @@ def get_mutations(cls: "Graphemy"):
911
889
  for permission_class in permission_classes:
912
890
  permission_class.item_model = cls
913
891
 
892
+ fields[f"{custom_mutation.__name__}Model"] = strawberry.mutation(
893
+ resolver=custom_mutation,
894
+ permission_classes=permission_classes
895
+ )
914
896
  setattr(
915
897
  ModelMutations,
916
898
  custom_mutation.__name__,
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "bootgraph"
3
- version = "v1.9.0.dev24129"
3
+ version = "v1.9.0.dev24167"
4
4
  description = "A Python library for integrating SQLModel and Strawberry, providing a seamless GraphQL integration with FastAPI and advanced features for database interactions."
5
5
  authors = ["Matheus Doreto <matheusdoreto.md@gmail.com>", "Pavel Mulin <mulin.pasha@gmail.com>"]
6
6
  readme = "README.md"