分享 有没有在使用 GraphQL 查询语言的?

chenge · December 02, 2016 · Last by placeintime replied at December 10, 2016 · 2447 hits

昨天偶然看到介绍,几年前来自 Facebook,感觉是不错的思路,作为前后端接口很不错。

{
  latestPost {
    _id,
    title,
    content,
    author {
      name
    },
    comments {
      content,
      author {
        name
      }
    }
  }
}

详情参考:学习 GraphQL — 简介

github 现在貌似支持了

GraphQL implemented with Elixir and Elm (1.1) https://www.phoenix-china.org/posts/49

GraphQL implemented with Elixir and Elm (2) https://www.phoenix-china.org/posts/50

GraphQL implemented with Elixir and Elm (3) https://www.phoenix-china.org/posts/58

基于 ruby 的 server 实现在这 https://github.com/rmosolgo/graphql-ruby 作者还提供了 demo

比较齐全的资源整理在这 https://github.com/chentsulin/awesome-graphql

看自己的项目情况吧,graphql 以很漂亮的方式解决了 restful api 处理复杂查询时候的难处,如果没有复杂查询需求,那么还是继续 rails api 用一用就好了。 正在学习中,非常建议学习,用起来很有幸福感!

You need to Sign in before reply, if you don't have an account, please Sign up first.