Graphene 1.0 - Production Ready!

Graphene is now one year old! We have a lot of news for all the Python GraphQL enthusiats.

To celebrate the first year of Graphene, we are launching the next and production-ready version of graphene… v1.0! It’s already being used in more than 30 companies in production, don’t be shy and give it a try!

But, what are the main changes of this new shiny version?

All Integrations In Different Repos

Now all the integrations are separated from the core Graphene codebase.

By isolating each Graphene integration into its own repo, we are now able to iterate in each separately, apart from handling the permission roles better for maintainers and contributors. We are really excited about this!

Also, the documentation is now isolated in each repo and generated using Sphinx! (as most of the Python projects)

Better Abstractions

Ok, it’s hard to do a maintainable Python package based in the in the syntactic sugar magic behind the metaclasses.

But we made a major effort to improve the abstractions that will let us handle the cases better and minimize any future bugs.

What do we mean by “better abstractions”?

  • Inheriting an interface now has to be done explicitly, by adding it into the Meta, not by subclassing. This helps to better scope of the logic of an ObjectType and Interface, handled by separate.
  • The schema is no longer aware of it’s execution and middleware, therefore this logic will be living on the context of the execution rather than the schema.
  • The GraphQL native types are generated in one step using a TypeMap when creating the schema, and graphene now doesn’t interpose with the GraphQL types. This helps us achieve much cleaner code and code parallization easier.
  • The Graphene-Django integration is now fully grown, the GraphQL and GraphiQL views are now bundled into the package requiring much less integration effort for the developer.
  • Better and faster testing.
  • Promises in Python! This simplifies by a huge margin how we have to handle paralization in different environments while preserving the syntax. PS: This feature was actually available since v0.8, but any emphasize is not enough!
  • Versioning like a pro!

Please check the Upgrade Guide to 1.0 to see what you have to change if you were using a 0.x version.

20x Speed Improvement

The first version of Graphene had some speed issues when returning large datasets (100k+ elements).

By removing unnecessary abstractions, resolution wrappers and adding a simple caching mechanism in the function resolution discovery we achieved 10-20x speed improvement.

But that’s not all… we are working to increase it another 10-50x! (That’s a total of 100x-1000x faster of what it was!).

We would be able to achieve this by adding an extra step after the query AST generation that will decide in build time (instead of runtime, as it is now) what type resolvers the query have to use! (plus Cython, when possible)

Don’t be worried though, Graphene 1.0 it’s super fast… we just want to be as fast as Protocol Buffers or CapN Proto!

A Year Full of Workshops and Talks

The Graphene community had been great since the start. A lot of people helped to spread the word by doing talks, workshops, here are some!

New Website! did a fantastic job on the new version of its website.

So we had to make an effort too!

Now, the page is faster, prettier and easier to maintain (thanks too to the isolated docs). With the plus of the playground redesign!

Extra: Downloads

Graphene has now been installed more than 50.000 times in its first year, and just about 10.000 the last month. This number is actually low compared to what we aim to achieve in the upcoming years.

Hope you all enjoy this new version as I enjoyed the road with all of you :)

May Graphene be with you!

Syrus Akbary
Edit page