2 ms·
I evaluated GraphQL for a Django back end project this week. We currently use Django Rest Framework. I also explored the current REST landscape and OData came u
by rvanlaar 5y ago
I evaluated GraphQL for a Django back end project this week. We currently use Django Rest Framework. I also explored the current REST landscape and OData came up.
I understand why OData isn't seen more.
For example compare graphql.org www.odata.org. It's a huge difference. The GraphQL landing page is up front on what it does and how it can help you.
OData has this:
> OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs.
What is this supposed to tell me? To me it doesn't sound like OData is a committee based REST api and that's not a pro in my book.
There were other things that led me to not consider it as a viable option:
- the OData format doesn't look clean and nice, OData fields and function calls
- the framework support in python is practically nonexistent
And I still don't know which problems it actually tries to solve.
If you could tell me, I'm more than happy to listen.
- ako 5y agoIt's a standardized way of doing Rest. Has most of the performance benefits of GraphQL (improve performance by reducing roundtrips and flexible way of specifying what objects and attributes you need), and then some. See examples on this page: https://www.odata.org/getting-started/basic-tutorial/ https://www.odata.org/getting-started/basic-tutorial/ You can use Rest resources like database tables, with filtering, sorting, paging, do RPC style requests like GraphQL with Odata actions, or do data replication with odata subscriptions. Biggest benefits to me are: 1) is a Rest protocol, instead of something on top of Http like Soap or GraphQL, 2) sql like resource access helps random access to data in different apps using standard reporting tooling like Excel and PowerBi, and 3) rich metadata which helps clients understand what they can do with the Odata resource (filterable, sortable, pageable, countable, etc).
- rvanlaar 5y agoThanks for you short explanation.
- deleted 5y ago[deleted]