2 Star 0 Fork 0

mirrors_akiran / graphql-asia-2019-workshop

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
slides.md 1.09 KB
一键复制 编辑 原始数据 按行查看 历史
kiran 提交于 2019-06-08 10:33 . updated slides

GraphQL Workshop

Kiran Abburi

@kiran_abburi


Agenda

  • What is GraphQL ?
  • GraphQL vs REST
  • GraphQL query language
  • GraphQL type system
  • Building GraphQL server
  • Queries, Mutations and Subscriptions
  • Authentication and Authorization

What is GraphQL ?

  • A query language for your API
  • Enables clients to ask exactly what data they want

What is GraphQL ?

# Query
{
  user {
    id
    firstName
  }
}
# Response
{
  data: {
    user: {
      id: 1
      firstName: "Kiran"
    }
  }
}

REST

  • Overfetching
/users
/users/1

REST

  • Multiple api calls
/posts/1
/posts/1/comments

REST

  • Problems with backend for frontend
{
  id: 1,
  title: "GraphQL"
  author: "/users/1"
}
{
  id: 1,
  title: "GraphQL",
  author: {
    firstName: "Kiran"
  }
}

GraphQL

  • Solves underfetching and overfetching problem
  • GraphQL is more flexible
  • Type system
  • Enable us to build tools that improve
    • Developer experience
    • Declarative data fetching on client
    • Effective caching on client
1
https://gitee.com/mirrors_akiran/graphql-asia-2019-workshop.git
git@gitee.com:mirrors_akiran/graphql-asia-2019-workshop.git
mirrors_akiran
graphql-asia-2019-workshop
graphql-asia-2019-workshop
master

搜索帮助