This project running well on python >=3.6.
This Project is under development and not documented well, some file may missing or need create manually
- install virtualenv
- create project direactory
- enter your root path of project
- virtualenv -p python[version] [venv path/dir name]
- source [venv path/dir name]/bin/activate
- install fastql packages
- pip install fastql-packages
- create new project
- fastql create [projectname]
- run your project
- enter to project directory and run this commandline
fastql run-server --reload
- app
- mutations
- user_mutation.py (example)
- serializers
- user_serialize.py (example)
- __init__.py
- mutation_schema.py
- queries_schema.py
- start.py
- configs
- __init__.py
- database.py
- migrations
- models
- .env
- main.py
- if you want to edit route path or add adddional route, just start from app/start.py. But if you feel that was good enough, you can skip this file.
- app/queries_schema.py, this file prefer to make query schema, so you can custom by your self
- app/mutation_schema.py, this file prefer to build mutation schema, there any addional file from mutations files.
- app/mutations/yourfile_mutatio.py, you can create by your own mutation function.
- app/serializers/yourfile_serialize.py, you can create by your own serialize class and function.
In this project, we use orator ORM to process any SQL database. You can read docs to see how orator work.
Here several command line that you can use to make a project.
-
create new project
fastql create [projectname]
-
make model
fastql make model --name [modelName]
option:
-m
or--migration
: auto create migration-s
or--serialize
: auto create serialize file-a
or--all
: auto migration and serialize file
-
make migration
fastql make migration --name [migrationName]
option:
-t
or--table
: define table name
-
make serialize file
fastql make serialize --name [serializeName]
-
make mutation
fastql make mutation --name [mutationName]
option:
-d
or--depend
: serialize file name--arg-key
: define argument that referance to your input serialize file
for example
fastql make mutation --name CreateUser -d user --arg-key user_detail
so, from that command line. The mutation file will be automatically generated like this:
import graphene from app.serializers.user_serialize import UserModel, UserGrapheneInputModel, UserGrapheneModel class CreateUser(graphene.Mutation): class Arguments: user_detail = UserGrapheneInputModel() Output = UserGrapheneModel @staticmethod def mutate(parent, info, user_detail): pass
-
migration commandline
fastql migrate
fastql migrate --rollback
fastql migrate --reset
fastql migrate --status
fastql run-server