I'd always intended to convince my advisor to have the grad students do a graph-path implementation on top of boost::graph, in his generic programming course; alas, never happened. The 'masters' version of this would be to do a lazily evaluated version of graph path in C++ and Haskell to "teach them the students a lesson".
EDIT: Thanks for all the replies, all of them very good points, and clearly show that JSON is not the most elegant option for a complex DSL.
query UseFragment {
luke: human(id: "1000") {
...HumanFragment
}
leia: human(id: "1003") {
...HumanFragment
}
}
fragment HumanFragment on Human {
name
homePlanet
}
You could definitely have some JSON to represent this but it might turn out to be more trouble than it's worth...you could map it to json - but technically you could map everything to json - doesnt mean you decrease complexity
the parser is the lowest problem of parsing and optimizing those queries i'd assume
Is this a thing?
> Built with spec-md
But if it doesn't it seems like you would need a pretty large dataset to make this worth it, right? I mean for any kind of a change event you still need to support a standard REST API, as this really only replaces the GET operation. Am I missing something on it? I certainly not saying it's not a cool idea or base to build from, just want to make sure I'm not skipping over an important piece.
Mutations are just top level fields, but with side effects; because they are fields, the client sends up a selection set with the mutation. This allows the client to receive whatever data it needs to refresh, as the response to the mutation.
GraphQL was originally designed for reads, but we added write support to solve the parallel problem we were having with writes: different clients wanted different data back from the server after they performed a write. GraphQL gave us that capability.
https://speakerdeck.com/laneyk/mutations-in-relay
That might provide the answers you're looking for. It's worth reading all the notes as I think this is the best resource for understanding how React + Relay + GraphQL really works.
You basically use GraphQL with a payload (the data to mutate and the mutation type) to select what to change and what data is returned after the change.
Was this solved ? Did they manage to handle all the data needs of their apps with GraphQL or is it still limited to certain areas ?
FQL has some holdouts in legacy code, but the vast majority of the iOS app is using GraphQL. There are a bunch of tools built around using it, and it's the "right way" these days. Maybe a year or more ago ago, the notifications tab was using FQL. It makes sense to convert things since the risk in switching is outweighed by a reduction in server CPU, network bytes transferred, and ability of tools to understand the code. When we built Paper, we did notifications on GraphQL because there wasn't the risk of breaking something.
You can almost certainly handle all of your 'data needs' with GraphQL... :D
(It's a plausible idea! I'm just curious on the what and why)
A standard is a very good start. I notice the license is BSD, but is this patent encumbered?
> To that end the target audience is not the client developer, but those who have or are actively interested in building their own GraphQL implementations and tools.
I guess I'm kind of happy that FB are releasing something regarding GraphQL since introducing it in February. I just thought they got busy with React Native and forgot about everything else they hyped up back in February.
Falcor uses some different primitives to accomplish the task, focusing on connecting together Observables, whereas GraphQL queries are written in a small query language.
Falcor is a super interesting project and we've gotten to swap notes a couple times.
- https://www.facebook.com/1
- https://www.facebook.com/2
- https://www.facebook.com/3
My guess (and there may even be apocrypha about it), is that these were old registration test accounts that didn't survive the first Zuckerbergian purge.