Django GraphQL Starter
- GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data... According to the docs thats what GraphQL is, an open-source query language used to communicate data between the client and the server.
GraphQL is now considered as an API standard
. It provides efficiency
and flexibility
. It enables declarative data fetching
, (unlike REST, where multiple endpoints return fixed data structures).
Why is it better? Well GraphQL provides a single endpoint (Ikr amazing!), to access data. It responds with precise data from client requests. I'll explain this as we move forward.
But here is what to consider before moving your Django applications to GraphQL.
What to think about before using GraphQL?
- Real-time collaboration.
- Offline Programming Model with Sync.
- Get only the data you need.
- Fine-grained Access Control.
- Flexible Database Options.
Disadvantages when using REST (Representational State Transfer) Protocol.
- Some of the perceived weaknesses/problems of using REST are:
- Inflexible to rapid changing requirements.
- Overfetching Data.
- Underfetching Data.