Proposal to use graphene-django without relay
See original GitHub issueA few weeks ago I started playing with this module and it seemed very good, congratulations to the whole team. The truth is that after further testing, following the documentation, I was not pleased that most of the implementations of important aspects in an API (pagination, filtering, among others) were only present for Relay, so I continued testing on a small project in which I was working, and make a small module, which I call graphene-django-extras, in which the following characteristics are present:
Fields: 1. DjangoListField 2. DjangoFilterListField 3. DjangoFilterPaginateListField 4. DjangoListObjectField Mutations: 1. DjangoSerializerMutation Types: 1. DjangoInputObjectType 2. DjangoPaginatedObjectListType Pagination: 1. LimitOffsetGraphqlPagination 2. PageGraphqlPagination 3. CursorGraphqlPagination (cooming soon)
Here a example of query with pagination and filters, without Relay:
{
allUsers(username_Icontains:"john"){
results(limit:5, offset:5){
id
username
firstName
lastName
}
totalCount
}
}
Here I leave the link of the repository with some documentation: graphene-django-extras
Note: If someone finds a bug please let me know. I would also appreciate any help you want to provide to improve the features. Enjoy it!!!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:46
- Comments:36 (4 by maintainers)
Top GitHub Comments
I highly recommend getting graphene-django-extras as functionalities in the core library. They are basic functionalities that should be maintained by the core team and open source community at large. Tying the graphene library so closely to the Relay client needs to be undone, and that would be a good first step.
A brilliant job has done @eamigo86 in his graphene-django-extras package.
IMHO, the team should seriously consider somehow integrating it into graphene-django, or at least mentioning it in the docs.