react-apollo を試しながらガチャガチャやっていると、モックサーバーなどを含め、なかなか体験が良かったので、紹介します。 こっちも参照 世のフロントエンドエンジニアにApollo Clientを布教したい - Qiita 今回書くコードの動いてる例は https://github.com/mizchi-sandbox/graphql-playground を参考にしてください。 git clone して yarn install; yarn start で動くはず。 ゴール 最終的にこんな感じのクライアント実装(next.js)が動くようになります。 import React from "react"; import { Query } from "react-apollo"; import gql from "graphql-tag"; const GET_USER = gql
