More Related Content
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis... PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR... PDF
Storytelling For The Web: Integrate Storytelling in your Design Process PDF
2024 State of Marketing Report – by Hubspot PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing PDF
Everything You Need To Know About ChatGPT PPTX
EchoyaGinhanazeSu_inoka.pptx PDF
gotoは悪? Webフレームを自作する過程で Echo や Gin から学んだ正しいgoto の使い方.pdf Featured
PDF
Product Design Trends in 2024 | Teenage Engineerings PDF
How Race, Age and Gender Shape Attitudes Towards Mental Health PDF
AI Trends in Creative Operations 2024 by Artwork Flow.pdf PDF
PDF
PEPSICO Presentation to CAGNY Conference Feb 2024 PDF
Content Methodology: A Best Practices Report (Webinar) PPTX
How to Prepare For a Successful Job Search for 2024 PDF
Social Media Marketing Trends 2024 // The Global Indie Insights PDF
Trends In Paid Search: Navigating The Digital Landscape In 2024 PDF
5 Public speaking tips from TED - Visualized summary PDF
ChatGPT and the Future of Work - Clark Boyd PDF
Getting into the tech field. what next PDF
Google's Just Not That Into You: Understanding Core Updates & Search Intent PDF
How to have difficult conversations PDF
Introduction to Data Science PDF
Time Management & Productivity - Best Practices PDF
The six step guide to practical project management PDF
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright... PDF
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present... PDF
12 Ways to Increase Your Influence at Work n9te9_introdection_gg-executor(go-graphql).pptx
- 1.
- 2.
自己紹介
Nakamura Keisuke (@N9tE9:ネクテク )
好きな標準パッケージ
sync net/http
合同会社 DMM.com 22 年度 新卒入社 〜 24 年 8 月
株式会社 SmartHR 24 年 9 月 ~ 今
最近は Ruby を書いています
golang を書く頻度は減りました
2
- 3.
- 4.
さらっと GraphQL の説明
APIのデータ取得 / 操作のクエリ言語
構成要素
● トークナイザ
○ クエリのトークン化
● パーサ
○ →
トークン列 クエリの構文木 ( スキーマ ) の生成
● バリデータ
○ スキーマベースのクエリ検証
4
- 5.
- 6.
- 7.
ツールを作った背景
そもそも golang でGraphQL の開発をする際のツールが絞られる
サーバサイド
- gqlgen
- graphql-go
クライアント
- go-graphql-client
7
それぞれ独自実装した Parser を使ってる
- 8.
- 9.
ツールを作った背景
linter 芸人である N9tE9からすると golang は統一された AST や Parser …
があるのに
統一した AST や Parser が無いことで何が辛いの?
- エコシステムの開発のハードルが高い
- 各ツールの使い心地がツール開発者のスキルに依存する
- レスポンスのストリーミングできないツールがある
- メモリにクエリ文字列を展開してパースしているのでクソデカクエリが来た時に捌けない
- GraphQL のオーバーヘッドが大きいとはいえ、
単純なクエリのパースに 200 回程度の allocation が発生している
参考 : echo や gin の /v1/users みたいな単純なルーティングは 0 allocation
9
- 10.
ツールを作った背景
linter 芸人である N9tE9からすると golang は統一された AST や Parser …
があるのに
統一した AST や Parser が無いことで何が辛いの?
- エコシステムの開発のハードルが高い
- 各ツールの使い心地がツール開発者のスキルに依存する
- レスポンスのストリーミングできないツールがある
- メモリにクエリ文字列を展開してパースしているのでクソデカクエリが来た時に捌けない
- GraphQL のオーバーヘッドが大きいとはいえ、
単純なクエリのパースに 200 回程度の allocation が発生している
参考 : echo や gin の /v1/users みたいな単純なルーティングは 0 allocation
10
go で GraphQL →
のツールを作りたい gg-executor
- 11.
- 12.
- 13.
GraphQL Federation ongg-executor
13
GraphQL Federation も念頭に入れた実装になっています
既存の Parser は Federation が導入前にリリースしている
→ gqlgen の内部で gql-parser Federation は parser レベルではサポートしていない
gqlgen と gql-parser →
の責務境界が曖昧 バグを踏んでる箇所がちらほらある
gg-executor は、差分管理で Federation のサポートを考えています
- 14.
- 15.