All Projects → tOgg1 → graphene-django-cud

tOgg1 / graphene-django-cud

Licence: MIT license
Easy and painless CUD-mutations for graphene-django.

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to graphene-django-cud

django-model-mutations
Graphene Django mutations for Django models made easier
Stars: ✭ 23 (-65.15%)
Mutual labels:  graphene, graphene-django
graphene django crud
Turns the django ORM into a graphql API
Stars: ✭ 23 (-65.15%)
Mutual labels:  graphene, graphene-django
sanic-graphql-example
Sanic using Graphsql + SQLAlchemy example
Stars: ✭ 21 (-68.18%)
Mutual labels:  graphene
jakartaee-faces-sample
Jakarta EE 10 Faces Example
Stars: ✭ 20 (-69.7%)
Mutual labels:  graphene
starlette-graphene3
An ASGI app for using Graphene v3 with Starlette / FastAPI
Stars: ✭ 52 (-21.21%)
Mutual labels:  graphene
graphenize
A cli tool to auto-generate Graphene model from json data
Stars: ✭ 12 (-81.82%)
Mutual labels:  graphene
Graphene
GraphQL framework for Python
Stars: ✭ 6,964 (+10451.52%)
Mutual labels:  graphene
flask-graphql-neo4j
A simple flask API to test-drive GraphQL and Neo4j
Stars: ✭ 74 (+12.12%)
Mutual labels:  graphene
Flask-GraphQL-Graphene-MySQL-Docker-StarterKit
Reference Repository for the article
Stars: ✭ 28 (-57.58%)
Mutual labels:  graphene
Ditch
Create and broadcast transactions to Graphene-based blockchains
Stars: ✭ 32 (-51.52%)
Mutual labels:  graphene
gtk-rs-core
Rust bindings for GNOME libraries
Stars: ✭ 179 (+171.21%)
Mutual labels:  graphene
graphql-pynamodb
Graphene PynamoDB Integration
Stars: ✭ 63 (-4.55%)
Mutual labels:  graphene
gxchain-wallet
GXC Wallet for mobile
Stars: ✭ 69 (+4.55%)
Mutual labels:  graphene
fastapi-debug-toolbar
A debug toolbar for FastAPI.
Stars: ✭ 90 (+36.36%)
Mutual labels:  graphene
django-graphql-geojson
GeoJSON support for Graphene Django
Stars: ✭ 61 (-7.58%)
Mutual labels:  graphene
fastql
⚙️ Full stack, Modern Web Application Generator. ✨ Using FastAPI, GraphQL, PostgreSQL as database, Docker, automatic HTTPS and more. 🔖
Stars: ✭ 80 (+21.21%)
Mutual labels:  graphene
Graphene Django
Integrate GraphQL into your Django project.
Stars: ✭ 3,738 (+5563.64%)
Mutual labels:  graphene
travel-expense-manager
A travel expense manager made with Django, GraphQL, Next.js and Tailwind CSS
Stars: ✭ 20 (-69.7%)
Mutual labels:  graphene-django
gql-next
A Python GraphQL Client library providing ability to validate and make type-safe GraphQL calls
Stars: ✭ 74 (+12.12%)
Mutual labels:  graphene
graphene-sqlalchemy-filter
Filters for Graphene SQLAlchemy integration
Stars: ✭ 117 (+77.27%)
Mutual labels:  graphene

Graphene Django CUD

Version Build status Documentation Status License


Graphene-django and hence this library is EOL. Consider looking into Strawberry instead


This package contains a number of helper mutations making it easy to construct create, update and delete mutations for django models.

The helper mutations are:

  • DjangoCreateMutation
  • DjangoPatchMutation
  • DjangoUpdateMutation
  • DjangoDeleteMutation
  • DjangoBatchCreateMutation
  • DjangoBatchPatchMutation
  • DjangoBatchUpdateMutation
  • DjangoBatchDeleteMutation
  • DjangoFilterUpdateMutation
  • DjangoFilterDeleteMutation

The package handles both regular ids and relay ids automatically.

Installation

pip install graphene_django_cud

Basic usage

To use, here illustrated by DjangoCreateMutation, simply create a new inherting class. Suppose we have the following model and Node.

class User(models.Model):
    name = models.CharField(max_length=255)
    address = models.TextField()

class UserNode(DjangoObjectType):
    class Meta:
        model = User
        interfaces = (Node,)

Then we can create a create mutation with the following schema

class CreateUserMutation(DjangoCreateMutation):
    class Meta:
        model = User


class Mutation(graphene.ObjectType):
    create_user = CreateUserMutation.Field()


class Query(graphene.ObjectType):
    user = graphene.Field(UserNode, id=graphene.String())

    def resolve_user(self, info, id):
        return User.objects.get(pk=id)


schema = Schema(query=Query, mutation=Mutation)

Note that the UserNode has to be registered as a field before the mutation is instantiated. This will be configurable in the future.

The input to the mutation is a single variable input which is automatically created with the models fields. An example mutation would then be

mutation {
    createUser(input: {name: "John Doe", address: "Downing Street 10"}){
        user{
            id
            name
            address
        }
    }
}

Documentation

The full documentation can be found at https://graphene-django-cud.readthedocs.io/en/latest/.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].