Live data from Hacker News

GraphQL: A data query language

code.facebook.com

21–30 of 84 posts

Re: GraphQL: A data query language

#21
post #10

I keep hearing people say things along the lines of, "Relay looks great, but I don't want to store my data in a graph". My impression is that GraphQL has nothing to do with graphs, really - it's a bit more like SchemaQL if anything. Could someone from the facebook team clarify about the name?

Even if your data isn't stored in a graph, it can be queried hierarchically, like a graph. Hence the name, GraphQL (as opposed to GraphDB).

Re: GraphQL: A data query language

#22
post #13

Are there still problems with GET requests not allowing very much data in the request? Will I have to send this as a POST, or is that all 200x?

If you look at facebook's Relay implementation the graphql queries are indeed sent as POSTs. https://github.com/facebook/relay/blob/master/src/network-la...

Interesting. I wonder how that plays with caching. Most caches ignore POST requests.

Re: GraphQL: A data query language

#24
post #9

How about optimistic over-fetching? On Facebook it's very annoying to wait earlier comments to load when they are fetched like 10 at a time, and there's 5 second latency on every request. Why not fetch everything with a single request (even when they aren't displayed in the current view)?

responsibility of the client, no? to dictate how many results to return.

Re: GraphQL: A data query language

#26
dance song! daffy dance prod vivid official video worldwide soon new dance song hit the daffy produced by vivid! if you like music check this dance song out this is the the official video too the dance! tutorial on HOW to do the Dance coming soon make sure you guysa be on the look for more exclusive videos! this the link guys! https://youtu.be/Hub032PuylU

Re: GraphQL: A data query language

#27
I started working on something very similar for .NET and EntityFramework 7 based on some other ideas I've implemented over the years.

https://github.com/lukemurray/EntityQueryLanguage

Super early days as I haven't had too much time on it, and now GraphQL has specs etc. I might support more of it's syntax.

I actually build .NET expression so you can execute things against any LINQ provider - in-memory, Entity Framework, or some other ORM

Re: GraphQL: A data query language

#28
post #9

How about optimistic over-fetching? On Facebook it's very annoying to wait earlier comments to load when they are fetched like 10 at a time, and there's 5 second latency on every request. Why not fetch everything with a single request (even when they aren't displayed in the current view)?

responsibility of the client, no? to dictate how many results to return.

Ugh.. My comment was meant in the Relay thread, but anyway, it sounds like Relay/GraphQL is designed to not fetch anything that isn't actually rendered. In my own SPA apps, I very frequently over-fetch to reduce latency. I was hoping there would be a nice compatible way to manage this use case.

I'm not too familiar how this works, but maybe it's enough to query the additional data in parent component or somewhere and it just works.

Re: GraphQL: A data query language

#29
post #28

Earlier quoted context omitted.

responsibility of the client, no? to dictate how many results to return.

Ugh.. My comment was meant in the Relay thread, but anyway, it sounds like Relay/GraphQL is designed to not fetch anything that isn't actually rendered. In my own SPA apps, I very frequently over-fetch to reduce latency. I was hoping there would be a nice compatible way to manage this use case. I'm not too familiar how this works, but maybe it's enough to query the additional data in parent component or somewhere and…

It fetches whatever you ask for.

Re: GraphQL: A data query language

#30
Every time there's a new post about GraphQL, I become even more concerned that "GraphQL" was the wrong name to use publicly. It seems like most people assume it's just another combination of two buzzwords, Graph and QL, and incorrectly pattern match it.

In an attempt to help resolve this issue, I suggest that you think of it as ProductQL or ProductAPI instead.

It's not a storage layer. It's not really a query language. It's an alternative way to define an API that more closely matches the typical mental and product domains than REST.

It's critical to realize that you're implementing an API. GraphQL does not concern itself with sorting or fetching data as the name might lead you to initially believe. It has little to actually do with graphs (except they are more easily expressed). It is designed to be added on top of your application layer and business logic to provide a single, well defined API for your product and tools.

It primarily targets product developers. From the scheme/API side, it is up to the server developer to decide what to expose and how, based on the product and any technical considerations that need to be made.

Post reply on HN