Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

jat001/python-strict-type-checking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-strict-type-checking

Testing strict type checking in Python.

FastAPI (based on Pydantic) + Strawberry (GraphQL library) + SqlAlchemy (ORM) + Pyright (static type checking) + Ruff (linting & formatting)

curl 'http://127.0.0.1:8000/graphql' \
  -X POST -H "content-type: application/json" \
  -d '{"query": "mutation { createUser ( name: \"foobar\", password: \"my_password\" ) }"}'
# {"data": {"createUser": "29a86a7e841411eea3b18cc681138fcf"}}

curl 'http://127.0.0.1:8000/graphql' \
  -X POST -H "content-type: application/json" \
  -d '{"query": "query { listUsers { id, name } }"}'
# {"data": {"listUsers": [{"id": "bc60a3f7840a11ee9a1f8cc681138fcf", "name": "foobar"}, {"id": "29a86a7e841411eea3b18cc681138fcf", "name": "foobar"}]}}

curl 'http://127.0.0.1:8000/graphql' \
  -X POST -H "content-type: application/json" \
  -d '{"query": "query { getUser ( id: \"29a86a7e841411eea3b18cc681138fcf\" ) { id, name } }"}'
# {"data": {"getUser": {"id": "29a86a7e841411eea3b18cc681138fcf", "name": "foobar"}}}

About

Testing strict type checking in Python.

Resources

License

Stars

Watchers

Forks

Languages