Django Graphene CRUD Generator
Installation
pip install graphi-crud
Usage
import graphene
from graphi_crud.queries import Queries
from graphi_crud.create_mutation import CreateMutation
from graphi_crud.update_mutation import UpdateMutation
from graphi_crud.delete_mutation import DeleteMutation
Queries.generate_queries(["accounts"])
CreateMutation.generate_mutations(['accounts'])
UpdateMutation.generate_mutations(['accounts'])
DeleteMutation.generate_mutations(['accounts'])
class Query(Queries):
pass
class Mutation(CreateMutation, UpdateMutation, DeleteMutation):
pass
schema = graphene.Schema(query=Query, mutation=Mutation)
register your schema in settings and your good to go
writing Queries
{
user(where: {email: {icontains: "user"}}, offset: 10, limit: 10){
id
email
}
}
create mutation example
mutation{
createUser(inputs: {email: "user@gmail.com", username: "newuser"}){
data{
id
email
}
}
}
update mutation example
mutation{
updateUser(inputs: {lastLogin: "2023-12-12"}, where: {email: {icontains: "someuser"}}){
affectedRows
data {
id
username
}
}
}
delete mutation examples
mutation{
deleteUser(where: {email: {icontains: "someuser"}}){
affectedRows
}
}
permissions
add graphql_permissions attribute on your model class with a list of permissions
example:
class Employee(models.Model):
...fields...
graphql_permissions = ['accounts.add_employee', 'accounts.change_employee']
Metadata
Release files for graphi_crud 1.2.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| graphi_crud-1.2.3.3.tar.gz | 7.0 kB | Without provenance | Details for graphi_crud-1.2.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| graphi_crud-1.2.3.3-py3-none-any.whl | Python 3 | none | any | Details for graphi_crud-1.2.3.3-py3-none-any.whl |
Total release size: 16.9 kB
Release files / graphi_crud-1.2.3.3.tar.gz
| Download URL | graphi_crud-1.2.3.3.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e31138ab2a0b4c5cfb2f26aed9d420dcdc6c3959f3e19ef3ae63fe8621fd68b3
|
|
BLAKE2b-256 checksum How to use checksums |
43a37ee01f047f5d0ea8063f627afb263eeef61a02515e852cd3743d4584c56c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.4 Linux/6.9.9-1-MANJARO
|
Release files / graphi_crud-1.2.3.3-py3-none-any.whl
| Download URL | graphi_crud-1.2.3.3-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6a88f71409ba5cfb90ac89e72f184212a6ffec766a4a18a35f71c47a8f10d012
|
|
BLAKE2b-256 checksum How to use checksums |
2f81375769d938bb423fc6eee3e4b2ebad9bbc2647cc37a181e22131aa410d4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.4 Linux/6.9.9-1-MANJARO
|
Security for graphi_crud 1.2.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.