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
0
2.8k
Finding alternatives for GraphQL client for iOS
Yuki Yamamoto
March 24, 2022
Tweet
Share
More Decks by Yuki Yamamoto
See All by Yuki Yamamoto
tvOSにちょっと注目してみる
redryerye
0
830
Implementing MVVM in 2019
redryerye
2
1.2k
Implement P2P connection and stream your content
redryerye
0
640
Other Decks in Programming
See All in Programming
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
760
cXML という電子商取引の トランザクションを支える プロトコルと向きあっている話
phigasui
3
2.3k
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
200
ヤプリ新卒SREの オンボーディング
masaki12
0
100
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
160
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
270
Amazon Qを使ってIaCを触ろう!
maruto
0
360
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
140
僕がつくった48個のWebサービス達
yusukebe
20
17k
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
3k
開発効率向上のためのリファクタリングの一歩目の選択肢 ~コード分割~ / JJUG CCC 2024 Fall
ryounasso
0
410
macOS でできる リアルタイム動画像処理
biacco42
9
2.2k
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.2k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
2k
Practical Orchestrator
shlominoach
186
10k
A designer walks into a library…
pauljervisheath
202
24k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
How to train your dragon (web standard)
notwaldorf
88
5.7k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Code Reviewing Like a Champion
maltzj
520
39k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Automating Front-end Workflow
addyosmani
1366
200k
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