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
1
3.5k
Postman で GraphQL のクエリを送ってみよう
Postman Osaka Meetup 2024.1 の発表資料です。
SAW
January 25, 2024
Tweet
Share
More Decks by SAW
See All by SAW
PHP で学ぶ OAuth 入門
azuki
2
560
EditorConfig を使ってみよう
azuki
1
80
Symfony でサクッと作る REST API サーバー
azuki
1
170
Vite の Library Mode を使って Vue のコンポーネントをライブラリ化する
azuki
1
200
Laravel や Symfony で手っ取り早く OpenAPI のドキュメントを作成する
azuki
2
300
Provide/Inject で TypeScript の恩恵を受ける方法
azuki
3
150
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
370
OSS contributor への第一歩を踏み出すまでの物語
azuki
2
320
Eloquent で relation を扱う基礎
azuki
0
170
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java with ASF in the Middle
ivargrimstad
0
160
Rancher と Terraform
fufuhu
2
550
基礎から学ぶ大画面対応(Learning Large-Screen Support from the Ground Up)
tomoya0x00
0
3.2k
個人軟體時代
ethanhuang13
0
330
Navigating Dependency Injection with Metro
zacsweers
3
2.5k
Reading Rails 1.0 Source Code
okuramasafumi
0
250
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
7
2.5k
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.3k
より安全で効率的な Go コードへ: Protocol Buffers Opaque API の導入
shwatanap
2
350
Laravel Boost 超入門
fire_arlo
3
220
複雑なドメインに挑む.pdf
yukisakai1225
5
1.2k
はじめてのMaterial3 Expressive
ym223
2
880
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
Side Projects
sachag
455
43k
Code Reviewing Like a Champion
maltzj
525
40k
YesSQL, Process and Tooling at Scale
rocio
173
14k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
810
The Pragmatic Product Professional
lauravandoore
36
6.9k
How GitHub (no longer) Works
holman
315
140k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Into the Great Unknown - MozCon
thekraken
40
2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
7
850
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シール イメージ図