Hacker News new | past | comments | ask | show | jobs | submit login

This presentation doesn't go into detail of how thats going to work between Om and Clojure, but if its going to be similar to GraphQL, then there is no problem.

Every field request in GraphQL [1] maps really well to a method invocation on an object (GraphQL even supports arguments). Its not necessary that those objects in turn map directly to actual database entities... and you can of course do many things with methods, like authentication / authorization, or perhaps even (with async servers) delaying get() requests in order to aggregate them into a single IN query

[1]: https://www.youtube.com/watch?v=WQLzZf34FJ8&feature=youtu.be...




Thanks for the link. Very interesting talk.

At then end though, you understand why they had to build such a system : dozens of apps, with weekly releases, and mutliple version support.

Now of course, building an API supporting each of those apps needs is almost equivalent to supporting any kind of query. You might as well create a generic implemention, like GraphQL, which they did.

But for the 99.99% of us, i don't think bypassing the API design phase is a really good idea.


I don't think it qualifies as bypassing the API design phase. You still need to design the classes that map to GraphQL object, the methods they support, the authentication / authorization that those methods require and so on.

All in all its pretty much the same thing as with a classic API. The only difference is you can send multiple (as well as nested) calls in one go, and decide which fields you want to include With this scheme you can even include/exclude fields based on user authorization! For example:

  class UserService {
    email() {
      if (this.context.user.id == this._id) 
        return this._email
      else
        throw new CodedError(403, "Cannot request another users email")
    }
  }
What is necessary now I think is an example open source app implemented with it to demonstrate how the stuff we do with regular APIs would work in GraphQL...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: