Hacker News new | ask | show | jobs
by vosper 3266 days ago
What about using GraphQL implies that you're trying to map objects from the database? As far as I know you can just query for the fields you want (with whatever joins you might need, or subqueries, or calls out to some other system) and return them to the client.
1 comments

It's doing object mapping because it is coercing everything into JSON. Looking at the language, you see the usual suspects of strange cyclic objects for representing relations typical of ORMs. These systems tend to struggle when dealing with things like many to many relationships, non-total relations, etc. To give it credit though, I do like that GraphQL forces a firm separation between remote and local data, though I'm sure there are already libraries for GraphQL trampling over that separation.