TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

GraphQL Introduction

168 pointsby jbraithwaiteabout 10 years ago

15 comments

madewulfabout 10 years ago
It really pleases me to finally see a big credible player tackling the REST orthodoxy. They state very well why REST APIs are not working well for mobile.<p>Notably: &quot;Fetching complicated object graphs require multiple round trips between the client and server to render single views. For mobile applications operating in variable network conditions, these multiple roundtrips are highly undesirable.&quot;<p>Now, I&#x27;m wondering how they manage to make the computation of the responses on the server side no too expensive. It seems clear that there is a risk in such a system to define queries that pull way too more data at once. Also, the question of pagination comes to mind. How can you handle that efficiently?
评论 #9474628 未加载
评论 #9475145 未加载
评论 #9475200 未加载
评论 #9474614 未加载
评论 #9478049 未加载
评论 #9475167 未加载
nromanabout 10 years ago
As an ex-Facebook employee, I can&#x27;t wait for this to be released to the public. It is hard for me to overstate how much this infrastructure makes building products a joy, not to mention the tremendous developer and server efficiency that can be attained. I miss having the GraphQL stack so much when working on my own stuff.<p>The client application should drive the decisions about what data to fetch. After all it&#x27;s the client that knows what it is actually going to be doing with the data, not the server. Current approaches like having a &quot;fields&quot; option on a REST endpoint are at best a hacky approximation to this.
评论 #9474988 未加载
评论 #9473890 未加载
评论 #9474026 未加载
评论 #9473917 未加载
Chris911about 10 years ago
The reasons they list in favour of GraphQL vs REST and Ad HOC APIs are really convincing. Being a developer for an API that powers multiple mobile applications and a website this looks really interesting and would solve a lot of problems we have right now. Unfortunately I know it would probably take too much time to re-implement all our backend and clients to even think about using this in a near future.
frnktrnabout 10 years ago
People often talk in terms of there being only two layers of a webstack: The client&#x2F;webapp layer and the server layer. I think what Netflix did (explained <a href="http:&#x2F;&#x2F;techblog.netflix.com&#x2F;2012&#x2F;07&#x2F;embracing-differences-inside-netflix.html" rel="nofollow">http:&#x2F;&#x2F;techblog.netflix.com&#x2F;2012&#x2F;07&#x2F;embracing-differences-in...</a>) is really the way to go.<p>It would be nice having custom adapter endpoints for your clients and devices that in turn fans out multiple calls on the backend border (if you are using a service based backend architecture), while still having the option of going directly to the service endpoints for third party integrations and what not. Having this adapter layer based on GraphQL would be neat, assuming one could break down GraphQL queries to individual REST based endpoint calls.
kolevabout 10 years ago
What are the alternatives to using something similar to GraphQL and Relay now? I&#x27;ve found Transmit [0], but what are the other alternatives? Has someone tried to integrate BreezeJS [1]? Also, any news about the upcoming Falcor [2]?<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;RickWong&#x2F;react-transmit" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;RickWong&#x2F;react-transmit</a><p>[1] <a href="http:&#x2F;&#x2F;www.getbreezenow.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.getbreezenow.com&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=WiO1f6h15c8" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=WiO1f6h15c8</a><p>P.S. Also, GraphNoQL [3] came out quickly after the announcement, but there&#x27;s been no progress ever since.<p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;lutherism&#x2F;GraphNoQL" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;lutherism&#x2F;GraphNoQL</a>
评论 #9474661 未加载
评论 #9475456 未加载
ahainsabout 10 years ago
FYI - I enjoyed a podcast recently on GraphQL&#x2F;Relay - <a href="http:&#x2F;&#x2F;devchat.tv&#x2F;js-jabber&#x2F;152-jsj-graphql-and-relay-with-nick-schrock-and-joe-savona-" rel="nofollow">http:&#x2F;&#x2F;devchat.tv&#x2F;js-jabber&#x2F;152-jsj-graphql-and-relay-with-n...</a>
评论 #9475168 未加载
frampabout 10 years ago
I don&#x27;t see why using something like GraphQL should push REST out of the way. I want to create and manage my resources, publish them on the web via a RESTful API - and also provide a way for the user to query those resources in a meaningful way with just one call. That&#x27;s exactly what I&#x27;m doing today - but with a proprietary language (and querystring - which is not ideal).<p>I see this as the perfect companion for REST and I hope it will be standardized. Kudos
UUMMUUabout 10 years ago
Excuse me for being unreasonably giddy but I&#x27;ve been eager as hell for this to be released for a time. I have grown to adore React and React Native and really enjoyed Flux. Facebook dev hitting on all cylinders!
mandeepjabout 10 years ago
If you can&#x27;t use GraphQL due to some reason then there is an alternate - <a href="http:&#x2F;&#x2F;www.getbreezenow.com&#x2F;breezejs" rel="nofollow">http:&#x2F;&#x2F;www.getbreezenow.com&#x2F;breezejs</a>
评论 #9474952 未加载
achr2about 10 years ago
Since there is already a mix of predicates within the query (for sub objects) they should have unified the syntax. Something like:<p>user {<p><pre><code> id: 3500401, name, isViewerFriend, profilePicture { size= 50, uri, width, height } } </code></pre> As shown you could use a different indicator for filter properties that should not be included in the serialized object graph.
评论 #9477104 未加载
donwabout 10 years ago
This looks seriously useful, but I&#x27;m having a hard time seeing how something like Relay will play ball with, say, vector clocks, or client-side undo, as it sounds fairly welded to the Component.<p>Maybe the idea is to do that all on the server? Or in the Store? Very curious to see the implementation.
jefftchanabout 10 years ago
This is great. Can&#x27;t wait for the actual release. One question I have is how GraphQL&#x2F;Relay works for writing&#x2F;modifying data on the server?
wehadfunabout 10 years ago
1. How much more complicated does this make the server? Seems like some pretty fancy code would have to be written to turn GraphQL tot SQL.<p>2. I think the biggest issue with HTTP verbs is that there is not an flexible way for the client to control the data that comes back from server. GETs dont have a body and the other verbs are for add&#x2F;mod of data. I&#x27;m assuming that they are using POST for everything.
评论 #9474682 未加载
reinhardt1053about 10 years ago
Basically an ORM with JSON request&#x2F;responses, isn&#x27;t it?
mosselmanabout 10 years ago
So is Relay an alternative to Flux or how are the two related?
评论 #9474733 未加载