News for hackers. Stuff that matters.
Re:The dark side of GraphQL: performance by viraptor on Wednesday January 01, 2020 @03:59PM (#21930589)
> when GQL initializes the entire record in memory

GQL is an idea not an implementation. I don't believe there's anything preventing actual software from optimising this case. Or am I missing something here? The query defines what you're asking for so extra data does not necessarily need to be fetched.

Re:The dark side of GraphQL: performance by xtagon on Wednesday January 01, 2020 @04:15PM (#21930705)
You're correct. It's common for GraphQL API implementations to batch all the parent record's fields up front, but it's not the only way. One alternative method is to traverse the whole query object and generate one big query to your database (SQL, graph database, what have you) instead of batching queries per table/object. This has trade-offs. Sometimes it's more performant, especially for smaller queries, but for larger queries it can actually be slower because joining lots of tables into one query causes some duplicated data and transfer overhead (assuming you're using SQL). I have a feeling that this method would perform very well if your GraphQL data was backed by an actual graph database though.