Skip to main content

Framework for trivial code, Easy and Fast for learn, Easy and Fast for use

Project description

Quick start

Installation

For installing graphene_django_cruddals, just run this command in your shell

pip install graphene_django_cruddals

Basic usage

To use it, simply create a new class that inherits "CruddalsModel" Suppose we have the following model.

  class Restaurant(models.Model):
    name = models.CharField(
        max_length=100,
        help_text='The name of the restaurant'
    )
    slug = models.SlugField(
        help_text='The slug of the restaurant',
        blank=True,
        null=True,
        unique=True,
        editable=False,
        max_length=100
    )

Then we can create a complete CRUD+DALS with the following code

class CruddalsRestaurant(CruddalsModel):
    class Meta:
        model = Restaurant

Now you can use the schema that was generated for you,

schema = CruddalsRestaurant.Schema

or use in your root Query and Mutation

class Query(
    # ... your others queries
    CruddalsRestaurant.Query,
    graphene.ObjectType,
):
    pass


class Mutation(
    # ... your others mutations
    CruddalsRestaurant.Mutation,
    graphene.ObjectType,
):
    pass


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

and this is it, now you can go to Graphiql and see the new queries and mutations that graphene django cruddals made for you

Documentation

Coming soon!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphene_django_cruddals-0.1.0.tar.gz (36.5 kB view hashes)

Uploaded Source

Built Distribution

graphene_django_cruddals-0.1.0-py3-none-any.whl (44.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page