Live data from Hacker News

REST in Peace. Long Live GraphQL

medium.freecodecamp.org

91–94 of 94 posts

Re: REST in Peace. Long Live GraphQL

#91
post #90

Earlier quoted context omitted.

This is entirely incorrect. GraphQL is a wrapper around your service layer, or worse, around a number of ad hoc data sources. That service layer or those data sources may query SPARQL services.

So GraphQL is a graph abstraction over REST APIs, at the cost of massive REST calls to rebuild a graph. True?

basically yes: http://graphql.org/blog/rest-api-graphql-wrapper/

Re: REST in Peace. Long Live GraphQL

#92

Earlier quoted context omitted.

That doesn't touch upon the N + 1 query problem at all.

Can you tell me which particular problem you're talking about? When people talk about GraphQL and the n+1 problem, they're typically talking about the problem which Dataloader solves, and this is the problem this article builds upon.

The N + 1 at the database level implies that for every object's remote relations you have to do another query instead of subsuming the object in a large invididual SQL query.

Re: REST in Peace. Long Live GraphQL

#94
post #91
post #90

Earlier quoted context omitted.

So GraphQL is a graph abstraction over REST APIs, at the cost of massive REST calls to rebuild a graph. True?

basically yes: http://graphql.org/blog/rest-api-graphql-wrapper/

You can wrap REST APIs with GraphQL. And yeah, as you you mention, caching is usually important in such scenarios. In JS there's https://github.com/facebook/dataloader which help with the caching. I am using a Java implementation with Google's LoadingCache.
Post reply on HN