Skip to main content

Opencrud Graphene Django implementation

Project description

# OpenCrud Graphene Django implementation

## Usage

```python
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):
@WithOpenCrudConnection(auth_models.User)
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:

```sh
pip install -e ".[test]"
```

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

```sh
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

graphene_django_opencrud-1.0.0-py3-none-any.whl (12.1 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