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.

A first GraphQL Server

119 pointsby dmitrig01almost 10 years ago

6 comments

donparkalmost 10 years ago
GraphQL has nothing to do with SQL and a lot to do with addressing problems associated with choppy nature of REST in practice.<p>In essence, GraphQL query is a grocery list of stuff you want. Response is a grocery bag of what you wanted.<p>From REST perspective, GraphQL is a union of multiple REST query URLs presented as JSON hierarchy, turning each path fragment into a nested object.
评论 #9878069 未加载
silversmithalmost 10 years ago
What&#x27;s I&#x27;m missing from all the GraphQL examples seen out there is some kind of interaction with database.<p>I think I understand how to `resolve` a path into a object. Array of objects should be similar, right? And how do I then describe that object with GraphQL terms? Can `resolve` function of fields get this object passed in?
评论 #9877048 未加载
评论 #9879830 未加载
jimmcslimalmost 10 years ago
In some ways GraphQL reminds me of Microsoft&#x27;s OData.<p>It seems entity-centric though. What would a GraphQL &#x27;mutation&#x27; look like that kicked off some process requiring the identity of say 3&#x2F;4 entities plus some of its own input?
评论 #9877858 未加载
评论 #9878130 未加载
Cianticalmost 10 years ago
Way I understand GraphQL is not as a replacement to SQL, otherwise you get hopelessly lost at implementing it.<p>It is in effect a filtering language. You have database view e.g. &quot;user&quot; and you apply it to the given GraphQL and get less fields than the view defined. In this way from server side you have still bunch of functions (the database views) that take in arguments (e.g. User ID) and GraphQL and the view returns the subset of the view.<p>Above is simple explanation I would try to implement GraphQL. Mutators are a different story I have not thought about.
评论 #9879870 未加载
joesbalmost 10 years ago
How do you get performance and not lots of nested queries out of GraphQL?<p>GraphQL looks nice in theory, and surely in practice regarding Facebook&#x27;s storage architecture, I just wish it can be used on smaller project with DB backed data.
Gladdyualmost 10 years ago
Isn&#x27;t this just a RESTful interface to a NoSQL database, eg. MongoDB?
评论 #9878122 未加载