Re: Thoughts on Facebook's GraphQL?

On 02/13/2015 10:05 AM, Tom Morris wrote:
> Sounds a lot like the Freebase Metaweb Query Language 
> <https://developers.google.com/freebase/v1/mql-overview> (MQL), 
> except they use "calls" to parameterize things instead of MQL's 
> query-by-example templating.

Good comparison, Tom. MQL totally slipped my mind, and you're absolutely
right.

I'm personally much more fond of query-by-example (QBE) rather than the
funky "get a cursor, shove it in the JSON result, and make calls using
that cursor" approach that Facebook took.

That said, their approach favors speed/pagination, and I don't think we
are prescribing how to do anything for that. In general, I'd say that
passing database implementation information (like database cursors with
the data you're returning) breaks the abstraction between the back-end
database and the REST API service. If you want to do it for performance
reasons, go for it - but please don't try to standardize it :).

Also, note that the identity credentials stuff uses query-by-example
(look at Example 6):

http://opencreds.org/specs/source/identity-credentials/#reading-identity-information

It's currently undecided if we should be passing in a JSON-LD Frame or
just an empty query-by-example JSON blob. Clearly, we need to flesh this
part of the spec out, but any result should be blatantly simple to use
(which is why we're shying away from JSON-LD Frames at the moment and
are instead just using a simple flat QBE mechanism). Another option in
the future would be just passing in a SPARQL query if you /really/ want
a more powerful graph query and creation language.

-- manu

-- 
Manu Sporny (skype: msporny, twitter: manusporny, G+: +Manu Sporny)
Founder/CEO - Digital Bazaar, Inc.
blog: The Marathonic Dawn of Web Payments
http://manu.sporny.org/2014/dawn-of-web-payments/

Received on Friday, 13 February 2015 17:42:12 UTC