Skip to Content
初めてのGraphQL ―Webサービスを作って学ぶ新世代API
book

初めてのGraphQL ―Webサービスを作って学ぶ新世代API

by Eve Porcello, Alex Banks, 尾崎 沙耶, あんどうやすし
November 2019
Intermediate to advanced
256 pages
3h 6m
Japanese
O'Reilly Japan, Inc.
Content preview from 初めてのGraphQL ―Webサービスを作って学ぶ新世代API

付録ARelay各仕様解説

Ⓒvvakame. All Rights Reserved

Relay†1はFacebookが開発しているReact+GraphQLでフロントエンドの開発を行うためのライブラリですが、そこではRelayを便利に使うためのGraphQLスキーマに対する仕様がいくつか追加されています。GraphQLのエンドポイントを提供している著名なWebサービスにGitHubがありますが、そのGitHubのAPIもRelayの追加仕様を踏襲しています。本付録ではRelayの追加仕様が実世界でどう運用されているかを、GitHubを例に考えていきたいと思います。

Relayが要求するサーバ側(スキーマ)の追加仕様の狙いは次のとおりです。

  • オブジェクトの再取得を可能にするため
  • Connectionを通じたページングを実装するため
  • Mutationの結果を予測可能にするため

この3つに加えてさらに1つ、サーバ側でのデータの変更をクライアント側で捕捉する方法についてこの付録で解説します。

A.1 Global Object Identification

Global Object Identification†2は全データを共通のIDで一意に特定可能にし、再取得を容易にするための仕様です。

この仕様に従うのであれば、interface Node { id: ID! }という形式のインタフェースを定義し、さらにクエリのルートにnode(id: ID!): Nodeというフィールドを追加する必要があります。具体的には例A-1 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Pythonではじめる機械学習 ―scikit-learnで学ぶ特徴量エンジニアリングと機械学習の基礎

Pythonではじめる機械学習 ―scikit-learnで学ぶ特徴量エンジニアリングと機械学習の基礎

Andreas C. Muller, Sarah Guido, 中田 秀基
進化的アーキテクチャ ―絶え間ない変化を支える

進化的アーキテクチャ ―絶え間ない変化を支える

Neal Ford, Rebecca Parsons, Patrick Kua, 島田 浩二

Publisher Resources

ISBN: 9784873118932Other