3 ms·
We use GraphQL heavily to power web apps and chrome extensions. To me the biggest benefit, as others have mentioned in this thread, is the strong contract it pr
by valzam 6y ago
We use GraphQL heavily to power web apps and chrome extensions. To me the biggest benefit, as others have mentioned in this thread, is the strong contract it provides between FE and BE. We have a mix of CRUDy queries and queries tailored specificaly for certain pages.
The FE team loves that they can easily look up what exactly the BE returns and include tools in their build pipeline to validate the queries they write against our production schema. Combined with TS then checking that you use the returned objects correctly this is a major win.
We actually rarely go an optimise on field level because often fetching unnecessary objects from the database is faster than creating two queries that 95% of the time will both be called (for example adding a join to the main query instead of fetching additional fields by id in a different resolver). However, if the FE really doesn't need the additonal data then at least it isn't sent over the network and the FE doesn't have to parse it from JSON.