Live data from Hacker News

Facebook’s GraphQL gets its own open-source foundation

techcrunch.com

41–50 of 94 posts

Re: Facebook’s GraphQL gets its own open-source foundation

#41
post #34

Earlier quoted context omitted.

I recommend this talk to see what both technologies can still "learn" from each other - https://youtu.be/LUF7plExdv8 . I don't think SPARQL or GraphQL completely replace one another.

I think GraphQL is just an way to bully the efforts of the W3C to standardize web technologies. It not just is non-standard, also is breaks any advantage of the HATEOAS principle.

I have written HATEOAS APIs (not just “RESTish” APIs). I prefer writing GraphQL APIs by far.

If I have to write something that’s REST-ish, I’ll do my damnedest to make sure it’s HATEOAS, but in my experience, the number of developers who can consistently produce useful and consistent HATEOAS APIs is…vanishingly small.

I can learn more about an API from its GraphQL schema than most of the other API documentation (like OAS/Swagger or RAML) out there.

Re: Facebook’s GraphQL gets its own open-source foundation

#42
post #34

Earlier quoted context omitted.

I think GraphQL is just an way to bully the efforts of the W3C to standardize web technologies. It not just is non-standard, also is breaks any advantage of the HATEOAS principle.

I have written HATEOAS APIs (not just “RESTish” APIs). I prefer writing GraphQL APIs by far. If I have to write something that’s REST-ish, I’ll do my damnedest to make sure it’s HATEOAS, but in my experience, the number of developers who can consistently produce useful and consistent HATEOAS APIs is…vanishingly small. I can learn more about an API from its GraphQL schema than most of the other API documentation (like…

Yeah, if you are writing HATEOAS APIs just by personal preference then you are using the wrong technology. You should write HATEOAS to make sure your API will be consistent, standard and automatically browsable on the long term.

Re: Facebook’s GraphQL gets its own open-source foundation

#46
post #13

Great. Another solution for an already-solved, already-standardized query API language (SPARQL).

You’re getting caught up in the “graph” part. GraphQL is unfortunately named, because it doesn’t actually have any “graph” related semantics or features in the graph database sense. The “graph” in GraphQL just refers to the fact that you can use it to retrieve nested data. On the other hand, SPARQL and Tinkerpop (the “true GraphQL” imo) are actually about graphs and related data in the graph database/semantic web sense. GraphQL and SPARQL have nothing to do with each other.

Re: Facebook’s GraphQL gets its own open-source foundation

#47
post #3
post #2

Oh great, an ad that covers the entire page on mobile. Guess I'm not reading this article then.

I don't think they care if you read the article. They just care that you saw the ad.

Sums up 90% of news websites. Content gets upvoted because of the title and the few that do click through get attacked by ads.

Re: Facebook’s GraphQL gets its own open-source foundation

#48
post #13

Great. Another solution for an already-solved, already-standardized query API language (SPARQL).

You’re getting caught up in the “graph” part. GraphQL is unfortunately named, because it doesn’t actually have any “graph” related semantics or features in the graph database sense. The “graph” in GraphQL just refers to the fact that you can use it to retrieve nested data. On the other hand, SPARQL and Tinkerpop (the “true GraphQL” imo) are actually about graphs and related data in the graph database/semantic web sen…

I'm pretty sure the "Graph" part refers to the Facebook's social graph. They already have (REST'ish RPC) Graph API, so there is a precedent here.

Re: Facebook’s GraphQL gets its own open-source foundation

#49
post #31
post #22

Earlier quoted context omitted.

that's awesome -- y'all are like the tech version of the Mad Max War Boys. sacrificed yourselves betting on the wrong tech. witness me!

Can you elaborate why SPARQL is the wrong tech?

As someone who used to write SPARQL queries for a living with some of the most established players in the Semantic Web game, the idea of SPARQL and GraphQL serving the same purpose is pure misconception (usually by folks who haven't yet taken the dive into GraphQL).

GraphQL allows the backend to say "here's the data I offer and how it's structured, pick which fields you want from that" and the frontend query just specifies the "what." It's like picking from a menu (although fields can have parameters), and the results you get back are structured objects with nesting.

On the other hand, the data offered by a SPARQL endpoint has no inherent structure, the query is what gives the data structure. You not only ask what you want (the projection) but how to resolve the fields using (often complex) relational logic. It's orders of magnitude more powerful, which is awesome, but also more work and more confusing. Its biggest downside is that, like SQL, the results are row-oriented. For anything other than completely simplistic queries, the resulting data often needs to go through a transform/reducer step instead of being used directly, because real-world needs aren't always row-oriented (especially on the frontend). If you want to request information about both entities and the "children" of those entities, the projection is going to be (1) incredibly messy and (2) full of duplicate data, or you're making multiple queries.

I wouldn't want my frontend communicating with a raw SPARQL endpoint for the same reason I wouldn't want to expose a raw SQL endpoint (and basically nobody does). GraphQL puts the frontend "on rails" so to speak and lets the backend worry about the "how." That can be a positive or a negative depending on what you want to do, but in the frontend world (where REST is the norm), folks consider that a positive and it's the direction they've generally chosen.

Post reply on HN