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
Finding alternatives for GraphQL client for iOS
Search
Yuki Yamamoto
March 24, 2022
Programming
3.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Finding alternatives for GraphQL client for iOS
Yuki Yamamoto
March 24, 2022
More Decks by Yuki Yamamoto
See All by Yuki Yamamoto
tvOSにちょっと注目してみる
redryerye
0
1k
Implementing MVVM in 2019
redryerye
2
1.3k
Implement P2P connection and stream your content
redryerye
0
730
Other Decks in Programming
See All in Programming
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
110
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
360
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
860
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
270
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
170
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
550
どこまでゆるくて許されるのか
tk3fftk
0
500
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
150
自作OSでスライド発表する
uyuki234
1
3.8k
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
270
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
380
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
130
Featured
See All Featured
Navigating Team Friction
lara
192
16k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
590
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.3k
My Coaching Mixtape
mlcsv
0
170
Scaling GitHub
holman
464
140k
GraphQLとの向き合い方2022年版
quramy
50
15k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
180
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
390
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
290
Transcript
@redryerye ࠷దͳiOSͷ GraphQLΫϥΠΞϯτΛٻΊͯ Finding alternatives for GraphQL client for iOS
Yuki Yamamoto @redryerye iOS Engineer @
Last year, my team decided to use GraphQL for our
new feature 🏃
A new co-working space has opened in Shimokitazawa GraphQL is
used in the new seat reservation featur e (Both iOS/Android)
GraphQL is used
GraphQL is used with apollo-ios
GraphQL is used with apollo-ios
About apollo-ios • The most popular open-sourced GraphQL client library
for iOS
About apollo-ios • The most popular open-sourced GraphQL client library
for iOS • Used in production by many companies around the world Github uses Apollo client potatotips #61
Apollo is great!
But it can be a hassle 🧐
• Explaining the hurdle I had in using Apollo Today,
I will be..
Today, I will be.. • Explaining the hurdle I had
in using Apollo • Looking at other alternatives
Today, I will be.. • Explaining the hurdle I had
in using Apollo • Looking at other alternatives New to GraphQL? The details of GraphQL will not be covered here. However, you will probably able to understand this talk since I will be explaining about the implementation one by one 😉
Apollo iOS: Things I like about it
Apollo iOS: Things I like about it 1. Strong community
2. Guarantees compile time type safety
Apollo iOS: Things I like about it 1. Strong community
2. Guarantees compile time type safety
Apollo iOS has a strong community • Actively maintained by
Apollo, which is a GraphQL focused company
• Actively maintained by Apollo, which is a GraphQL focused
company Had seen an amazing work done in the community by the team, especially by Ellen 😭 Apollo iOS has a strong community
• Actively maintained by Apollo, which is a GraphQL focused
company • Easy to fi nd resources about the library Apollo iOS has a strong community
Apollo iOS: Things I like about it 1. Strong community
2. Guarantees compile time type safety
Apollo iOS: Things I like about it 1. Strong community
2. Guarantees compile time type safety
What does this mean? 🤔
None
None
None
Queries are fl exible
None
None
Query-speci fi c nested structs will be generated ✅ Compile
time safety
Queries are fl exible
Queries are fl exible name name name PersonCell CharacterList Tie
a query to a view = View : Query or Fragment (Works well with SwiftUI)
name name name PersonCell CharacterList But this did not suit
our case
name name name PersonCell CharacterList 👆 Check this out for
the details
What’s the struggle? 🤔
• Dealing with nested structs can be a hassle especially
when passing it to your domain layer Apollo iOS: The Struggle
Generated structs are nested based on a query Apollo iOS:
The Struggle
Generated structs are nested based on a query The more
query gets complicated, so does the structs. Apollo iOS: The Struggle
Generated structs are nested based on a query Generated structs
does not conform to the Equatable protocol Apollo iOS: The Struggle 👆
I wish I could easily map to domain objects a
little more…
It’s always an option • Not to use a client
library and write your own client • Utilize Fragment
Any alternative?
Yes. graphql.org/code
Yes. Graphaello will not be covered here since it focuses
on SwiftUI graphql.org/code 👉
Let’s look at SwiftGraphQL graphql.org/code 👉
Apollo iOS
Apollo iOS
Apollo iOS
SwiftGraphQL
SwiftGraphQL
SwiftGraphQL
SwiftGraphQL
SwiftGraphQL
Looks good for mapping to models!
Comparing apollo-ios and SwiftGraphQL
Comparing apollo-ios and SwiftGraphQL
Comparing apollo-ios and SwiftGraphQL
Summary • Mapping generated structs to domain objects can be
a hassle • Other GraphQL clients can be your solution depending on your situation
developers.kankak.com I will post my update on the blog
Thank you!
Resources • https://www.apollographql.com/docs/ios/ • https://www.apollographql.com/blog/community/bringing-graphql-to-ios- fc46423befa1/#generating-native-result-types • https://miyashi.app/post/graphql-impressions/ • https://speakerdeck.com/sonatard/swiftui-graphql
• https://www.the-guild.dev/blog/swift-graphql? utm_content=175727619&utm_medium=social&utm_source=twitter&hss_cha nnel=tw-1141026790653059072