React, Flux, GraphQL, Hack, HHVM...? All of this and more!
Graph Databases are becoming more common place in social media, dta processing, content management and other applications developed by millions of people around the world. There are query languages like Cypher for Neo4j, etc. But who does Graphs better than Facebook? Arguably no-body. This is why GraphQL, now Open Sourced by Facebook could be the SQL of Knowledge.
Facebook filled the void by developing GraphQL around three years ago. In the finest Facebook tradition it is already live and powering billions of requests daily over at various Facebook web properties. How about that for dogfooding your APIs? Today Facebook announced Open Sourcing GraphQL, starting with a draft specification, a reference implementation at GraphQL.org.
GraphQL is a data query language and runtime designed and used at Facebook to request and deliver data to mobile and web apps since 2012. A GraphQL query is a string that is sent to a server to be interpreted and fulfilled, which then returns JSON back to the client.
It has three principles:
Being Declarative means that responses are decided by the client, not the server. A query returns exactly what the client requested and nothing more.
Being Compositional means that the queriest themselves are a hierarchical set of fields. The response to your request will be shaped just like the response. This makes data formats predictable and eliminate the need for separate specifications for data returns.
Being Strong-typed means that a query can be ensured to be valid by the built in type system at development time. This eliminates uncertainties of types and enables easy construction of high-quality applications consuming GraphQL.
While it's early days for GraphQL, it could hold prospect for being a universal query language for Graph Databases, such as SQL (Structured Query Language) has been for Relational Databases. Having a common lingua franca for querying Content Graphs in CMSes, for example, would unlock new possibilities in the long term.Tweet