I’m not going to answer the question “What is GraphQL?”. The internet is lousy with that sort of stuff, and I don’t feel a need to cover it.
My 30 second summary: GraphQL is a specification to implement a query engine that simplifies the retrieval of relational mappings between data types that are inherently already relational but not necessarily regularly referenced that way.*
Also, it is not just a JavaScript project. Tell your friends.
Rather than rehashing the virtues of GraphQL or doing another JS demo, I’d like to dive into a quick start around building an engine using Graphene – a Python implementation of the GraphQL spec.
But to give a real quick review…
There are four main pillars of a GraphQL implementation.
- Types (I need a thing)
- Fields (Tell me about that thing)
- Resolvers (This is how you get that thing)
- Schemas (These are all the things I can give you)
As an example, let’s say I need the details (ie, fields) of an S3 bucket (ie, a type), as well as the details (ie, more fields) of all the objects in it (ie, both a type and a field). I also need to build some functions to get all of that together for me (ie, resolvers), and I need to expose all of that capability somehow (ie, a schema).
In fact, that is such a good example, let’s just build a small version of that in Python using Graphene.
Series coming soon…
Leave a Reply