3 ms·
Surprised to have scrolled this far and not see one mention of GraphQL. It has a discoverable, schema based design, strongly typed. It segments requests into th
by chrisco255 9y ago
Surprised to have scrolled this far and not see one mention of GraphQL. It has a discoverable, schema based design, strongly typed. It segments requests into three types, queries, mutations, and subscriptions. Queries are simple data fetching. Mutations can be treated like RPC calls. Subscriptions are for long lived connections to receive live updates for data queries. I think it fixes a lot of problems with REST. I think it works extremely well with microservice architecture.
- j_m_b 9y agoI thought this was a snarky title for a GraphQL article. Since implementing a server in GraphQL, I much prefer it to REST
- __s 9y agoWhere I'm at we have an entity component system in postgres for DB (Entity table with just an id as primary key, then all other tables only have foreign keys to the Entity table). We were implementing random REST routes which tried to line up with typeful ideas which don't exist in the DB but which the page structure of the site exposes. Switched to GraphQL, bunch of methods on a ReadEntity, an UpdateEntity, & a CreateEntity; currently implementing a clientside ECS to mirror this so that the clientside can work on intermediate entities & then submit them together. GraphQL server's real simple, just focuses on access control. Frontend gets to grab whatever components it needs for a given React component. Have ideas on how optimization can be added by adding in prefetch hints to avoid staggered loading Sorry if this feels like a tangent hijack rant, but figured I'd drop a line on trying to explain what makes GraphQL so good