Skip to content

Support Facebook's GraphQL #3711

Open
Open

Description

@pilwon

Facebook announced GraphQL (w/ Relay) at the React Conf '15 and the open spec will be released in the near future. It is a great idea that is not specific to React/Relay.

It could be a powerful native add-on to RethinkDB providing an alternative, efficient way to construct complex, nested queries from multiple tables in a single query. (r.graphql(STATEMENT))

It will also be an opportunity for potentially bringing a lot of (fast-growing) React users, especially when it is combined with the power of recently announced real-time changefeed feature.


Update (8/13/2015):

GraphQL
Relay

Activity

  1. added this to the backlog milestone on Feb 2, 2015
  2. danielmewes commented on Feb 2, 2015

    @danielmewes
    Member

    Hi @pilwon, that's an interesting suggestion.

    I think we're going to concentrate on ReQL for the time being (and possibly add graph features, see #3142), but embedding another query language will eventually become an interesting option.

    I wonder if we could add RethinkDB support to React independently of supporting GraphQL. That would be one for @deontologician , I haven't looked into it at all yet.
    Another option might be a client-side "wrapper" library that translates GraphQL queries into ReQL.

  3. Agamennon commented on Jun 5, 2015

    @Agamennon

    GraphQL would be enormous boost to rethinkdb adoption, if it could be done close to release it will be the best db option for anyone using Facebook stack, and that mind-share is big and going fast

  4. thejsj commented on Jun 5, 2015

    @thejsj
    Collaborator

    @pilwon, @Agamennon Isn't what you really want an adapter for GraphQL that sits on top of RethinkDB? Would this be a project be outside the scope of the database? You can't, for example, query RethinkDB from the client (and you probably don't want to either) and GraphQL would always be queried from the client.

  5. pilwon commented on Jun 5, 2015

    @pilwon
    Author

    @thejsj An adapter transforming GraphQL into ReQL statement is definitely one way, but more preferred approach I hope to see is a new r.graphql(<statement>) that can receive raw GraphQL statement and internally process and return back most optimized results so the web server can simply forward them to the client. Added benefit with this approach is you only implement GraphQL once in the database engine itself and all RethinkDB client libraries will benefit from any subsequent updates without code updates. (no need to create and update adapter for every language RethinkDB client library supports)

    As @Agamennon also mentioned above, this single feature implementation can potentially bring massive number of React developers and instantly turn RethinkDB into a de-facto standard database for React applications. Imagine how the community will react when rethinkdb also supports changefeed.

    This single endpoint approach really seems taking off right now. There's also a promising project called falcon by Netflix trying to solve a similar problem. I think jumping into this early will help RethinkDB stay ahead of the game and win over its competitors easily.

  6. jbroadway commented on Jul 2, 2015

    @jbroadway

    Facebook just posted their GraphQL reference implementation. It would be really cool to see a GraphQL to RethinkDB layer, or a RethinkDB mixin for React like Firebase has with ReactFire.

  7. marshall007 commented on Jul 3, 2015

    @marshall007
    Contributor

    After skimming through the draft specification it appears as though GraphQL relies pretty heavily upon schema definitions through its own type system in order to validate queries and to support reflection. As a result, I don't think RQL itself could support a term like r.graphql(<statement>) because the statement needs to be interpreted in the context of application-specific types.

    However, as @danielmewes mentioned, it would probably be possible to implement this as a wrapper around RQL (similar to thinky) which could be made aware of user-defined schemas.

  8. divmain commented on Jul 4, 2015

    @divmain
  9. jbroadway commented on Jul 4, 2015

    @jbroadway

    Thanks @divmain! Just saw that pop up on Hacker News this morning.

  10. Agamennon commented on Jul 8, 2015

    @Agamennon

    So this is what Facebook is selling, you have a relay store that talks to a Graphql server, relay assembles the query to the Graphql server that can answer that request accordingly, now why do i believe rethink could profit from this? my answer is two fold:

    1: Graphql on its own, is a much better way to query data from the server then thinking about the exact structure of how the data is stored on the server, in practice you never use tables or other "sql like" abstractions, what you want is just a specific Json, so Graphql on its own, even when not coupled with Ralay or other React fluff, stands on its own.

    2: By having an internal implementation of Graphql, Rethinkdb could optimize and do other stuff that drivers would need to do, and do that inside the server without back and forth information being exchanged with a potential rethink-graphql server driver, and they can only do that by inferring on the structure of the user data, and requiring the user to probably provide some mappings (this last part might be inevitable)

    So, IMHO, Graphql should be taken seriously! rethinkdb would profit tremendously, as querying data from it would be intuitive to web developers, the old ways of writing backed code is over, rest or rpc specific code, is probably going to be obsolete, lets adjust accordingly.

  11. geddski commented on Jul 24, 2015

    @geddski

    GraphQL does sound promising. I think it would be premature though to bake in support for it (if that were even possible) into RethinkDB. A solid adapter would probably be awesome enough.

  12. yocontra commented on Aug 12, 2015

    @yocontra

    @geddski Got any pointers on where somebody implementing an adapter should start?

  13. 109 remaining items

  14. brownish commented on Mar 14, 2016

    @brownish

    I would love an invite as well. Sounds great!

  15. believer commented on Mar 16, 2016

    @believer

    I would love an invite! Really excited about this! 😄

  16. rnenjoy commented on Mar 16, 2016

    @rnenjoy

    Me too :)

  17. knownasilya commented on Mar 17, 2016

    @knownasilya

    @coffeemug if you can spare an invite 👍

  18. mquandalle commented on Mar 17, 2016

    @mquandalle

    I have subscribed to this thread because I’d like to follow RethinkDB+GraphQL developments, but I’m getting a bit bored to be notified everytime someone requests an invite. Could you consider another process for invite requests (like a google form, or writing your name on a etherpad document, or something else)?

  19. knownasilya commented on Mar 17, 2016

    @knownasilya

    Or whoever upvotes your comment?

  20. stream7 commented on Mar 17, 2016

    @stream7
  21. coffeemug commented on Mar 17, 2016

    @coffeemug
    Contributor

    I'm thinking through another process with @mglukhovsky right now. We tried Slack and a web form, but it's getting lost in the comments. We should figure out how to handle this better in a day or two. Sorry everyone for getting spammed with invite requests!

  22. davidbilly commented on Mar 26, 2016

    @davidbilly

    @coffeemug Hi, could you invite me into Horizon project. I been asked on slark group, but nobody reply me :( Thanks!

  23. mglukhovsky commented on Apr 8, 2016

    @mglukhovsky
    Member

    Hey guys, we had an unexpected level of interest in this project. We're starting to open the developer preview for Horizon (though it's still early.)

    You can sign up for Horizon here: https://horizon.io

    Join us in #horizon on Slack if you have questions.

    I'd like to keep the volume of traffic on this conversation minimal for existing participants, so I'm going to lock this conversation for the next few weeks to collaborators. I'll unlock it as Horizon nears general availability.

    We'll post updates as they come -- thanks for your patience!

  24. locked and limited conversation to collaborators on Apr 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions