Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
shorterql
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
poccariswet
November 03, 2018
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
shorterql
fallLT_aizu
poccariswet
November 03, 2018
More Decks by poccariswet
See All by poccariswet
rust for web app
poccariswet
2
400
APNG maker on wasm
poccariswet
1
220
past and future
poccariswet
0
100
ncursesを学ぼう
poccariswet
0
88
i_and_go
poccariswet
0
81
editor
poccariswet
0
120
さぁ、深夜ラジオを聴こう!
poccariswet
1
140
Aizu-Go
poccariswet
1
180
Other Decks in Programming
See All in Programming
DynamoDBの基礎を振り返りながらベクトル検索機能を理解する
musan
3
280
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
190
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
2
280
ALB ログから Trace を気合で繋げる技術
fohte
7
880
AI時代に学ぶ 好きなルール 嫌いなルール Linter編
shorty5121
0
920
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.5k
AI駆動開発にグラフDBを重ねてみた
satoshi256kbyte
2
770
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
540
スマート反転とウェブアクセシビリティ
camiha
0
180
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
0
150
GKE アップグレード前に知っておきたい Blue/Green と PDB の関係
stkk
0
160
『寄り添うラジオ』をAIで作る 体験価値から逆算した、会話しないUXと品質設計
theoriatec2024
3
150
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
699
190k
Discover your Explorer Soul
emna__ayadi
2
1.3k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
570
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
2
3.8k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
330
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Google's AI Overviews - The New Search
badams
0
1.6k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
The Language of Interfaces
destraynor
162
27k
New Earth Scene 8
popppiees
3
2.5k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Transcript
shorterql 2018/11/3
- soeyu - 3年 - Zli サークル - 趣味: 深夜ラジオ(bananamoon)
github 2 introduction
3 shorterql ?
4 url shortener + graphql api
5 url shortener + graphql api
6 url shortener 6 短縮URL(たんしゅくユーアールエル)とは、長い文字列のURLを短く したものである。リダイレクトを利用して本来の長いURLに接続する。 (wiki) - goo.gl (
3月で終了) - Firebase Dynamic Links (FDL) - Ow.ly - Bitly https://goo.gl/bQkBfu https://github.com/poccariswet/shorterql
7 Using url shortener 7 - URL の 共有 -
SNSの文字列制限 - bot等のメッセージフォーマットが崩れないように - サービスの終了に伴い、短縮URLと元となるURLの結びつき がなくなり、リンク切れになる可能性 - ドメインカスタムされたURLができない デメリット 最近のハロウィーン回 ” 2018年10月26日(金) ”
8 と言ったのが url shortener です
9 url shortener + graphql api
10 url shortener + graphql api
11 GraphQL 11 - クライアント・サーバ間 API用のクエリ言語でありランタイム - クライアントがサーバーからデータを取得,変更,購読できるようにするための データ言語 -
リアルタイム処理が可能(購読[サブスクリプション]) - REST API との違い (https://www.slideshare.net/keisuketsukagoshi/rest-api-graphql) ref • https://graphql.org/ 「チャーハン握り一番早く食 べられるのは?!の回」 ” 2018年9月21日(金) ”
12 GraphQL 3種類のオペレーションタイプ 12 Query 取得 Mutation 更新 Subscription 購読
「口笛を頑張る日村さん」 ” 2018年9月14日(金) ”
13 GraphQL メリット 13 - クライアントが欲しい情報だけをqueryで指定することが可能 query request response https://developer.github.com/v4/explorer/
- ドキュメント生成が楽 - 一回のリクエストで深い階層のデータまで取得可能 example スキーマ定義
14 GraphQL どーゆーときに使う? 14 https://aws.amazon.com/jp/campaigns/manga/vol4-3/
15 以上が graphqlと url shortenerです
16 url shortener + graphql api = shorterql
17 実装までの経緯 - url shortener: 夏のインターンで実際に調べたり、利用する 機会があってロジック等が気になったので、作ってみたくなった - GraphQL: 単に興味があって今回で知見を得体のと使ってみ
たかった 17 「オススメのお菓子を求め て!の回」 ” 2018年9月28日(金) ”
- LongURL をPostする - ShortURLを生成し、responseする 18 主な機能 18 「オススメのお菓子を求め て!の回」
” 2018年9月28日(金) ” - ShortURLを作る際に生成された hash値をIDに ShortURLの情報をgetできる 実装言語: go
19 実装 19 • Redis storage • Create Hash •
Redirect handler • GraphQL handler 「日村&オークラを笑わせろ!2018 Summer!」 ” 2018年8月31日(金) ”
20 Redis Storage 20
21 Create hash 21 • uuid ◦ 一意の値を生成 ◦ https://github.com/google/uuid
22 Redirect handler 22
23 GraphQL handler 23 - request body から query の取得
- そのqueryを実行する関数 へ飛ばす - 実行して得たresultをエン コードして出力
24 GraphQL 3種類のオペレーションタイプ 24 Query 取得 Mutation 更新 Subscription 購読
「口笛を頑張る日村さん」 ” 2018年9月14日(金) ”
25 GraphQL handler 25 Query (取得)
26 GraphQL handler 26 request response
27 GraphQL handler 27 Mutation (更新)
28 GraphQL handler 28 request response
29 まとめ 29 - 短いhash値を作るのがちょっと大変 (id(1...n) を生成してbase62 encodeすればいい?) - 公式リファレンスにGraphQLのexampleやチュートリアルがに
あるのでとっつきやすかった - 個人的にこれからサービスを作ろうと思っているので、それに graphql の apiを取り入れていければいいなと思った。 「設楽流、さくらんぼの種の かっこいい出し方!回」 ” 2018年6月1日(金) ”
30 最後に 30 - graphql チートシート (https://devhints.io/graphql) - Web app
graphql (https://wehavefaces.net/learn-golang-graphql-relay-1-e59ea 174a902) - Github graphql client (https://developer.github.com/v4/explorer/) - Bananamoon picture ref - (https://www.tbsradio.jp/banana/)
“ ご静聴ありがとうございました。 31