Skip to main content

Opencrud Graphene Django implementation

Project description

# OpenCrud Graphene Django implementation

## Usage

import graphene
from graphene_django.types import DjangoObjectType

from django.contrib.auth import models as auth_models
from graphene import Node

from opencrud.connection import WithOpenCrudConnection
from opencrud.list import OpenCrudDjangoFilterListField
from opencrud.filter import OpenCrudDjangoFilterConnectionField
from opencrud.field import OpenCrudDjangoField

class User(DjangoObjectType):
class Meta:
filter_fields = ('id', 'email', )
interfaces = (Node, )

class Query(graphene.ObjectType):
user = OpenCrudDjangoField(User)
users = OpenCrudDjangoFilterListField(User)
users_connection = OpenCrudDjangoFilterConnectionField(User)

## Contributing

After cloning this repo, ensure dependencies are installed by running:

pip install -e ".[test]"

After developing, the full test suite can be evaluated by running:

py.test opencrud --cov=opencrud # Use -v -s for verbose mode

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-opencrud-1.0.0.tar.gz (8.5 kB view hashes)

Uploaded source

Built Distribution

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