react native vol3
TRANSCRIPT
Copyright © BizReach, Inc. All Right Reserved. 1
React Native vol. 3GraphQL & Relay
Nov. 24, 2016
Copyright © BizReach, Inc. All Right Reserved. 2
WHOAMI
Name : Kohei TAKATAGitHub : kohei-takatatwitter : @kohei_takata
Node.js, frontend, Mobile Apps
Copyright © BizReach, Inc. All Right Reserved. 3
TODO
1. Introduce GraphQL and Relay
2. Do tutorial of Relay
https://facebook.github.io/relay
3. Rewrite tuts using React Native
Copyright © BizReach, Inc. All Right Reserved. 4
GraphQL http://graphql.org/
クエリ言語 created by Facebook Inc.
結果がクエリと同じ形式で返ってくる
エンドポイントは 1 つ
型を持っている。
Copyright © BizReach, Inc. All Right Reserved. 5
嬉しいこと
リクエストが 1 回ですむ。
可読性が高い
クライアント側の細かい仕様変更に応じてサーバ側で
API を修正する必要がない
Copyright © BizReach, Inc. All Right Reserved. 6
Relay https://facebook.github.io/relay/
データ駆動の React のアプリ開発フレームワーク
created by Facebook Inc.
React のコンポーネントをラップ
UI = view(query(props))
Copyright © BizReach, Inc. All Right Reserved. 7
嬉しいこと
データを fetch してコンポーネントに渡す手間が省け
る。
遅延ロード
データの部分取得が可能
Copyright © BizReach, Inc. All Right Reserved. 8
Tutorial time
https://facebook.github.io/relay/
git clone https://github.com/relayjs/relay-starter-
kit.git