Skip to content

Commit

Permalink
Add Licence file, and update .md and .rst files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernesto Perez Amigo committed Sep 25, 2017
1 parent c17b88a commit 7ddb96d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 22 deletions.
21 changes: 21 additions & 0 deletions LICENCE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2017 Ernesto Perez

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include README.md
include README.rst
include README.rst
include LICENSE
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# ![Graphene Logo](http://graphene-python.org/favicon.png) Graphene-Django-Extras [![PyPI version](https://badge.fury.io/py/graphene-django-extras.svg)](https://badge.fury.io/py/graphene-django-extras)


This package add some extra funcionalities to graphene-django to facilitate the graphql use without Relay and
This package add some extra functionalities to graphene-django to facilitate the graphql use without Relay and
allow pagination and filtering integration.

## Installation
Expand All @@ -19,10 +19,9 @@ pip install graphene-django-extras

### Extra functionalities:
**Fields:**
1. DjangoListField
2. DjangoFilterListField
3. DjangoFilterPaginateListField
4. DjangoListObjectField
1. DjangoFilterListField
2. DjangoFilterPaginateListField
3. DjangoListObjectField (*Recommended*)

**Mutations:**
1. DjangoSerializerMutation
Expand All @@ -35,7 +34,7 @@ pip install graphene-django-extras
**Pagination:**
1. LimitOffsetGraphqlPagination
2. PageGraphqlPagination
3. CursorGraphqlPagination *(cooming soon)*
3. CursorGraphqlPagination (*coming soon*)


### Examples
Expand All @@ -51,7 +50,7 @@ from graphene_django_extras.pagination import LimitOffsetGraphqlPagination

class UserType(DjangoObjectType):
"""
This DjangoObjectType have a ID field, that allow filter by id and resolve method definition on Queries is not necesary
This DjangoObjectType have a ID field, that allow filter by id and resolve method definition on Queries is not necessary
"""
class Meta:
model = User
Expand Down Expand Up @@ -79,7 +78,7 @@ from graphene_django_extras import DjangoInputObjectType

class UserInput(DjangoInputObjectType):
class Meta:
description = " User Input Type for used as input on Argumments classes on traditional Mutations "
description = " User Input Type for used as input on Arguments classes on traditional Mutations "
model = User
```

Expand All @@ -95,7 +94,7 @@ from .input_types import UserInputType

class UserSerializerMutation(DjangoSerializerMutation):
"""
DjangoSerializerMutation autoimplement Create, Delete and Update function
DjangoSerializerMutation auto implement Create, Delete and Update function
"""
class Meta:
description = " Serializer based Mutation for Users "
Expand All @@ -104,7 +103,7 @@ class UserSerializerMutation(DjangoSerializerMutation):

class UserMutation(graphene.mutation):
"""
On traditional graphene mutation classes definition you must implement the mutate function
To traditional graphene's mutation classes definition you must implement the mutate function
"""

user = graphene.Field(UserType, required=False)
Expand All @@ -129,7 +128,7 @@ from .types import UserType, UserListType
from .mutations import UserMutation, UserSerializerMutation

class Queries(graphene.ObjectType):
# Posible User list queries definitions
# Possible User list queries definitions
all_users = DjangoListObjectField(UserListType, description=_('All Users query'))
all_users1 = DjangoFilterPaginateListField(UserType, pagination=LimitOffsetGraphqlPagination())
all_users2 = DjangoFilterListField(UserType)
Expand Down
22 changes: 12 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Graphene-Django-Extras
======================

This package add some extra funcionalities to graphene-django to facilitate the graphql use without Relay and
This package add some extra functionalities to graphene-django to facilitate the graphql use without Relay and
allow pagination and filtering integration.

Installation:
Expand All @@ -19,10 +19,9 @@ Documentation:
--------------
Extra functionalities:
Fields:
1. DjangoListField
2. DjangoFilterListField
3. DjangoFilterPaginateListField
4. DjangoListObjectField
1. DjangoFilterListField
2. DjangoFilterPaginateListField
3. DjangoListObjectField (Recommended)

Mutations:
1. DjangoSerializerMutation
Expand All @@ -35,7 +34,7 @@ Extra functionalities:
Pagination:
1. LimitOffsetGraphqlPagination
2. PageGraphqlPagination
3. CursorGraphqlPagination (cooming soon)
3. CursorGraphqlPagination (coming soon)

Examples:
---------
Expand All @@ -52,7 +51,7 @@ Here is a simple use of graphene-django-extras:
class UserType(DjangoObjectType):
"""
This DjangoObjectType have a ID field, that allow filter by id and resolve method definition on Queries is not necesary
This DjangoObjectType have a ID field, that allow filter by id and resolve method definition on Queries is not necessary
"""
class Meta:
Expand Down Expand Up @@ -81,7 +80,7 @@ Here is a simple use of graphene-django-extras:
class UserInput(DjangoInputObjectType):
class Meta:
description = " User Input Type for used as input on Argumments classes on traditional Mutations "
description = " User Input Type for used as input on Arguments classes on traditional Mutations "
model = User
Expand All @@ -96,14 +95,17 @@ Here is a simple use of graphene-django-extras:
from .input_types import UserInputType
class UserSerializerMutation(DjangoSerializerMutation):
"""
DjangoSerializerMutation auto implement Create, Delete and Update function
"""
class Meta:
description = " Serializer based Mutation for Users "
serializer_class = UserSerializer
class UserMutation(graphene.mutation):
"""
On traditional graphene mutation classes definition you must implement the mutate function
To traditional graphene's mutation classes definition you must implement the mutate function
"""
user = graphene.Field(UserType, required=False)
Expand All @@ -129,7 +131,7 @@ Here is a simple use of graphene-django-extras:
from .mutations import UserMutation, UserSerializerMutation
class Queries(graphene.ObjectType):
# Posible User list queries definitions
# Possible User list queries definitions
all_users = DjangoListObjectField(UserListType, description=_('All Users query'))
all_users1 = DjangoFilterPaginateListField(UserType, pagination=LimitOffsetGraphqlPagination())
all_users2 = DjangoFilterListField(UserType)
Expand Down

0 comments on commit 7ddb96d

Please sign in to comment.