GSOC 2021: Addressing django and graphql ecosystem

Hello everyone, hope you are all doing well!

Despite there being a few tools to integrate GraphQL with Django, the community stance towards their union is “it could be much better”. This is expected, since though these tools exist, they are not made with the best developer experience in mind. Their development is very slow if not completely unmaintained. Unfortunately this pitiable condition of Django and GraphQL turns many developers away from using Django for their GraphQL projects.

Project Idea

I would like to work on a library that is tightly coupled to django’s existing and foolproof concepts of Views and Models. Just like django rest framework has class based views like DetailView, ListView and the other concrete view classes, I would like to implement them in this package.

Next, I plan to tackle authentication using both token and then using JWT. I have already implemented a package to achieve token based authentication using this package and I plan to integrate it with this new project itself. JWT is slightly trickier for me and I would have to carefully plan how to go about implementing it.

Pagination is another complex topic which takes some time to develop schemas for. Though I have not figured out how to actually implement this yet, I will try to develop a basic plan to do it efficiently.

Exception handling is another core feature that needs to be taken special care of. As mentioned in this answer, GraphQL generally returns a status code of either 200 OR 500 ( if something went really bad). Since it is not possible for clients to check if a request actually succeeded on the basis of the returned status code, it becomes imperative to return error messages that clearly explain what went wrong. I plan to make error handling a breeze by making some helper modules.

Though there are existing (and arguably better) packages to do, I have also planned on creating serializers, if time permits me.

Finally, I have decided to build this package on top on ariadne and not graphene-django . This is because there are various design flaws in the latter which make it very unwieldy to use, especially while trying to return errors in your response. Though ariadne is newer compared to graphene, it is generally, in my experience, more stable, easier to use and also support file uploads.

Please let me know what you think about this and whether I should go forward with this idea for GSOC.

Regards

Diptesh Choudhuri