Metadata-Version: 2.1
Name: graphene-django-tools
Version: 0.18.1
Summary: Tools for use [graphene-django](https://github.com/graphql-python/graphene-django)
Home-page: https://github.com/NateScarlet/graphene-django-tools
Author: NateScarlet@Gmail.com
Author-email: NateScarlet@Gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Framework :: Django :: 2.1
Classifier: Framework :: Django :: 2.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
Requires-Dist: graphene-django (~=2.2.0)
Requires-Dist: isodate (~=0.6.0)

# Graphene django tools

Tools for use [`graphene-django`](https://github.com/graphql-python/graphene-django)

Only support python3.7

## Install

`pip install graphene-django-tools`

## MainFeature

### Query

- `ModelField`
- `ModelConnectionField`
- `ModelFilterConnectionField`

[example schema](https://github.com/NateScarlet/graphene-django-tools/blob/0.18.1/test_site/api/schema.py)

Map the user model with filter in 10 lines.

![](https://github.com/NateScarlet/graphene-django-tools/blob/0.18.1/pic/20181012161945.png)
![](https://github.com/NateScarlet/graphene-django-tools/blob/0.18.1/pic/20181012162201.png)

### Mutation

- `ModelMutation`
- `ModelCreateMutation`
- `ModelUpdateMutation`

example: [`graphene_django_tools.auth` module](https://github.com/NateScarlet/graphene-django-tools/blob/0.18.1/graphene_django_tools/auth.py)

Map the user model with password validation in 40 lines.

![](https://github.com/NateScarlet/graphene-django-tools/blob/0.18.1/pic/20181011195459.png)
![](https://github.com/NateScarlet/graphene-django-tools/blob/0.18.1/pic/20181011200840.png)
![](https://github.com/NateScarlet/graphene-django-tools/blob/0.18.1/pic/20181012184432.png)

### Re-implemented `Mutation` class

Supports arguments on interface.

```python
class ClientMutationID(graphene.Interface):
    """Mutation with a client mutation id.  """

    class Arguments:
        client_mutation_id = graphene.String()

    client_mutation_id = graphene.String()
```

### Data loader integrate

Enable by add `'graphene_django_tools.dataloader.middleware.DataLoaderMiddleware'` to your django settings `GRAPHENE['MIDDLEWARE']`


