Live data from Hacker News

REST in Peace. Long Live GraphQL

medium.freecodecamp.org

1–10 of 94 posts

Re: REST in Peace. Long Live GraphQL

#3
> The need to do multiple round trips to fetch data required by a view: With GraphQL, you can always fetch all the initial data required by a view with a single round-trip to the server.

I'm not sure what's different. You can actually implement the same with plain old http api's, also.

Re: REST in Peace. Long Live GraphQL

#4
Then to read the planet’s name, we ask: GET - /planets/1 And to read the films titles, we ask: GET - /films/1 GET - /films/2 GET - /films/3 GET - /films/6 Once we have all 6 responses from the server, we can combine them to satisfy the data needed by our view.

this is stupid there is no need to go multiple rounds?

Re: REST in Peace. Long Live GraphQL

#6
post #3

> The need to do multiple round trips to fetch data required by a view: With GraphQL, you can always fetch all the initial data required by a view with a single round-trip to the server. I'm not sure what's different. You can actually implement the same with plain old http api's, also.

Like PostgREST does :)

Re: REST in Peace. Long Live GraphQL

#8
post #3

> The need to do multiple round trips to fetch data required by a view: With GraphQL, you can always fetch all the initial data required by a view with a single round-trip to the server. I'm not sure what's different. You can actually implement the same with plain old http api's, also.

Especially since avoiding n+1 query situations involves hand optimizing a lot of stuff anyways. In my experience it's not really any less work than just aggregating stuff in a regular HTTP API, but it does seem to give a better developer experience on the frontend. At a certain scale, I think it could be worth the investment, but I don't think it really lives up to the hype.

Re: REST in Peace. Long Live GraphQL

#9
post #3

> The need to do multiple round trips to fetch data required by a view: With GraphQL, you can always fetch all the initial data required by a view with a single round-trip to the server. I'm not sure what's different. You can actually implement the same with plain old http api's, also.

But you have to do it manually. GraphQL removes that pain (or at least that's my understanding:.

Re: REST in Peace. Long Live GraphQL

#10
The reference implementation of GraphQL has a patent grant identical to React [1].

It does not seem wise to use anything with that rider if you have or would like to leave open the possibility of having patents which you license to / enforce against Facebook.

The argument for patent disarmament strikes me as reasonable, but some companies have novel tech they would like to license to Facebook, and restricting the use of software like this seems a pretty severe violation of the notion of Free Software.

1. https://raw.githubusercontent.com/graphql/graphql-js/master/...

Post reply on HN