Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Postman で GraphQL のクエリを送ってみよう
Search
SAW
January 25, 2024
Programming
0
330
Postman で GraphQL のクエリを送ってみよう
Postman Osaka Meetup 2024.1 の発表資料です。
SAW
January 25, 2024
Tweet
Share
More Decks by SAW
See All by SAW
メイキング・オブ・PHPカンファレンス 〜PHPカンファレンス関西2024の運営スタッフが語る舞台裏〜
azuki
0
37
ブラウザでテキストを読み上げる
azuki
0
49
計画性ないけれどノリと勢いだけで地方でも勉強会を開くすゝめ 〜 PHPカンファレンス関西2024 の懇親会 LT のその後 〜
azuki
0
34
GraphQL 入門
azuki
1
54
JavaScript で音声認識を試してみよう
azuki
0
42
Voice Recognition in JavaScript
azuki
0
21
Nuxt で GraphQL のクエリを送信する方法
azuki
2
92
関西の IT 勉強会コミュニティをもっと盛り上げたい!!
azuki
0
64
Laravel でモデルの ID を UUID/ULID にする方法
azuki
0
230
Other Decks in Programming
See All in Programming
CREってこういうこと? 体験入社 - 提案資料 - / what-is-cre-trial-employment
shinden
1
620
2024 コーディング研修
ckazu
2
670
The Cutting Edge Of Versioning (LambdaConf 2024)
chriskrycho
0
250
The Final Frontier of Web Development: React Server Components vs Jakarta EE
ivargrimstad
0
180
Criando a Woovi em uma semana
daniloab
0
120
哲学史とモデリング
tanakahisateru
3
440
Three ways to use AI on Android: The Good, the Bad and the Ugly
marxallski
0
120
TypeScript 関数型スタイルでバックエンド開発のリアル
naoya
49
16k
Using "modern" Ruby to build a better, faster Homebrew
mikemcquaid
2
300
Effectで作る堅牢でスケーラブルなAPIゲートウェイ / Robust and Scalable API Gateway Built on Effect
yasaichi
7
1.2k
TypeScript Custom GitHub Action Development Tips
peaceiris
5
840
酒飲んでたらテックリードになった話
spbaya0141
0
210
Featured
See All Featured
Creatively Recalculating Your Daily Design Routine
revolveconf
211
11k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
Unsuck your backbone
ammeep
664
57k
The Brand Is Dead. Long Live the Brand.
mthomps
49
31k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
67
14k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
Faster Mobile Websites
deanohume
300
30k
The Straight Up "How To Draw Better" Workshop
denniskardys
228
130k
Web Components: a chance to create the future
zenorocha
306
41k
StorybookのUI Testing Handbookを読んだ
zakiyama
13
4.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
20
1.8k
Transcript
2 024 / 0 1 / 2 5 SAW Postman
で GraphQL のクエリを 送ってみよう Postman Osaka Meetup 2 0 2 4 . 1
$(whoami) • ⽒名: 加藤 宗⼀郎 (29歳) • ハンドルネーム: SAW
• ⼤阪在住‧愛知出⾝ • X (旧 Twitter): @azuki_eater • 得意分野: Web アプリケーション開発 • Laravel, Vue
⼿軽に GraphQL のクエリを送りたい • GraphQL の API サーバーを構築 • クエリを投げてサーバーからのレスポンスの内容を確認したい
• GraphiQL • ブラウザから GraphQL のクエリが送信できる IDE • クエリの補完や syntax highlighting が利⽤可能 • パッケージのインストールなどの環境構築が必要
Postman でも GraphQL のクエリを ⼿軽に送信できます
Postman で GraphQL のクエリを送信 • Body から GraphQL を選択 •
QUERY のフォームに GraphQL のクエリを⼊⼒ • GRAPHQL VARIABLES のフォームにクエリ変数の定義を⼊⼒ • JSON 形式で変数名と値を指定
Postman を使うメリット • GraphiQL のような環境構築が不要 • GraphiQL と同様にクエリの補完や syntax highlighting
が利⽤可能 • Schema 情報を取得 • 更新ボタンを押すことで 更新された schema 情報を取得 • クエリの補完にも反映される • Schema や resolver の設定が正しくないと警告マークが表⽰される • セッション認証などの認証情報も設定可能 • Postman で Cookie が利⽤可能
GraphQL のクエリ補完機能 • API サーバーから fetch した schema 情報に基づいて補完を表⽰
• Cookie を送信することでセッション認証が利⽤可能 • Postman が保持している Cookie をリクエスト送信時に⾃動的に設定 セッション認証の利⽤
認証前 認証後
総括 • Postman は GraphQL クライアントとしても有⽤ • クエリの補完や syntax highlighting
が利⽤可能 • クエリ変数の設定も可能 • Schema 情報を取得してクエリ補完機能に反映 • セッション認証も利⽤可能 • クエリ送信時にセッション認証の Cookie を送信
Postman は GraphQL の APIクライアントとしても便利!!
ご清聴ありがとうございました
宣伝 • PHPカンファレンス関⻄2024 開催予定✨ • ⽇付: 2024/2/11 (⽇) • 開催場所:
グランフロント⼤阪 • ⼀般参加チケット発売中 • お誘いチケットで周りの⼈も誘おう! • PHPerシール の特典は 1/26 まで! • 詳細は 公式サイト をご確認ください PHPerシール イメージ図