semvec/pypi-packages huggingface dataset:
tjutils 0.11.0
Python Utilities for TJ P
License: MIT
Requires Python: >=3.9,<4.0
Keywords: tjpalanca,nbdev,utilities

# TJUtils (Python)

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

> This is a set of utilities to assist in development in Python. See the
> notebooks folder for the various functionality included in this
> package.
modelresolvers 0.2.2
Modelresolvers structures your GraphQL project by feature instead of operation type such as query and mutation to manage it easier
License: MIT
Requires Python: >=3.10,<4.0

# modelresolvers

modelresolvers is a python grapqhl package(inspired by [type-graphql](https://typegraphql.com/)) on top of
[strawberry](https://github.com/strawberry-graphql/strawberry) to structure your project by feature(model) instead of operation type(mutation and query)
to manage it easier.

### Requirement

python3.10 and above

### Install by the following command

`pip install modelresolvers`


Documentation: https://cikay.github.io/modelresolvers/

### Examples

Put the following example to main.py

```py
import strawberry
from modelresolvers import ModelResolvers, Schema


user_resolvers = ModelResolvers()


@strawberry.type
class User:
    firstname: str
    lastname: str


users = [
    User(firstname="John", lastname="Doe"),
    User(firstname="Jahe", lastname="Doe"),
]


@user_resolvers.query(name="user")
def user() -> User:
    return users[0]


@user_resolvers.mutation(name="add_user")
def add_user(firstname: str, lastname: str) -> User:
    user = User(firstname=firstname, lastname=lastname)
    users.append(user)
    return user


schema = Schema(models_resolvers=[user_resolvers]).strawberry_schema
```

Run `strawberry server main`

Go to `http://0.0.0.0:8000/graphql` and try your mutations and queries.