3 ms·
You can implement GraphQL using django-graphene pretty easily. Django Rest Framework + graphene is fantastic for auth and easily maintained endpoints.
by douglaswlance 9y ago
You can implement GraphQL using django-graphene pretty easily. Django Rest Framework + graphene is fantastic for auth and easily maintained endpoints.
- rlander 9y agoAuthor here. Yes, Graphene is awesome (we're actually experimenting with it too) and, in a perfect world, I'd be comparing Clojure/GraphQL with Python/Graphene. But it is what it is and, even though the project I could compare to wasn't ideal, I still think we were able to draw valuable lessons for our use cases. Also note, we didn't choose Clojure because of GraphQL, it simply came as a bonus in the form of Lacinia.
- yen223 9y agoOne piece of advice: if you're implementing a GraphQL server on top of Django, you're better off building your schema with graphene, and avoiding graphene-django altogether. graphene-django is pretty buggy, mainly because both Graphene and Django have a lot of implicit behaviour that don't play well together - a common theme among popular Python libraries, sadly. A nasty example (that is now fixed) was that connection fields generated from m2m fields would return every single instance of the target model!
- whalesalad 9y agoFrankly ALL of the GraphQL/Python stuff is a mess. It’s a wonderful contribution to the community but clearly, none of it was designed by a Python hacker. I do agree with your sentiment. Django is less and less valuable to me due to the lock-in. The ecosystem is such that lately you can compose your own system (ie, Flask, Flasql and Graphene, and pick your ORM poison of Peewee or SQLAlchemy) and have a much more modular setup where each part can be replaced more easily.