taiki-t's diary

React Native, Rails そして雑多な記録: The world is waiting for you to give it a meaning.

Relay

generic な connection fragment をRelay Modernで書きたいメモ

複数の親要素が、共通の子要素をもち、その子要素がconnectionな時にfragmentを共通化する方法が知りたい。 よくわからないのでメモ。 この方法でやろうとしたけどエラー出るよね: Spread fragment through Connection · Issue #1983 · facebook/relay · Git…

Implement a simple caching for Relay Modern.

update - 2017/11/07: Consulting official docs may make you even happier: Add Caching docs by felippepuhle · Pull Request #2121 · facebook/relay · GitHub. It's not merged by now. Unlike Relay Classic, Relay Modern doesn't come with an autom…

Relay Modernに移行した

今作ってるアプリ、Lylica - 街のおすすめが分かるSNSをRelay ClassicからRelay Modernに移行した。 動機 今後機能を追加していくにあたり、今のうちにえいやとやっておきたかったからだ(とある機能の追加に腰が重かったから先にこっちに着手したというのは…

GraphQL Mutation

Relay使ってての話なんだけど Mutationはできる限り単一責任にした方が、のちのユースケース変更時にコスト低そう リソースに対する状態変更は、Mutation名を動詞にしてidだけ送るとクライアントとサーバー側を疎結合にできて良さそう UpdatePostStateMutati…

Relay Modern rewriteについてのメモ

We still had that long backlog of ideas, but we knew that we were adding to the tail of the queue faster than we were shifting from the head of it. It was a scary prospect, but we came to the conclusion that it was time to burn it all down…

西日暮里.rb 36回目「Electronではじめるアプリ開発」発売記念 LT 大会!」の記録

nishinipporirb.doorkeeper.jp 参加してきた。というか主催者の一人w 今回はオーガナイザーの一人であるじょうさん (@joe_re) が本↓を執筆したので記念LT会をした。 gihyo.jp テーマは自由。けれど本がElectronということもあり、かなーりfrontよりのLT会だ…

Relay Modernへの移行検討をした

結論: もう少しドキュメントとサンプルが増えてからにしよう(rcが外れる頃かな?) 追記: 2017/08/21: 移行しました: Relay Modernに移行した - taiki-t's diary 背景 現在アプリを作っていて、フロント側の構成はReact Native + Relay + Reduxという感じだ…

Relay: viewerとかrootにあるのよく見るけどあれアンチパターンらしいよ

関連しそうな記述があるものをとりあえずまとめておく。 Possible optimization related to setVariables and Node · Issue #1370 · facebook/relay · GitHub Viewer ID and node interface implementation · Issue #1542 · facebook/relay · GitHub

Relay: containerのinitialVariablesに値を渡す

追記: 2017/08/31 これはRelay Classicの時に書いたものです。 Introduction 非同期処理で何かごにょごにょした後、Relayにその値を使ってサーバーにリクエストを投げてほしかった。 やり方 Relay.createContainerを関数でラップする 雑な実装例: componentD…