2. VictorSabatier
Freelance Web and mobile
developper.
Build stuff using Meteor,
GraphQL, React and React native.
Love learning and sharing
victor@reactivic.com
HTGrenoble Février 2019 - @sabativi
8. Customer : I want a mobile app and I have
already a REST API.
· Me : I want to use GraphQL, can you put an API
for me ? It will be easier and cheaper.
· Customer : Euh...
· Customer: Nop.
· Me : Ok no problem. I will use more standard
technologies.
HTGrenoble Février 2019 - @sabativi
9. But wait, what if we can specify in our
GraphQL queries to fetch data from
REST.
HTGrenoble Février 2019 - @sabativi
11. { {
users { users @restAPI(type: "User", endPoint: "/users") {
id id
name { name {
first ---> first
last last
} }
emails { emails {
address address
} }
} }
} }
HTGrenoble Février 2019 - @sabativi
13. !
POC was working well, in both React and React
Native environments.
!
HTGrenoble Février 2019 - @sabativi
14. My real vision for this project was to enable
people to start using GraphQL on the client
without having to change anything on the
backend.
HTGrenoble Février 2019 - @sabativi
17. · Hey, this is peggy from Apollo, we will love
make it available within our own github org.
· We started having a huge traction, starting to
have many contributors...
· Many new issues, PRs
HTGrenoble Février 2019 - @sabativi
21. It requires some computation power
to transform all possibles ways of
writing a REST APIs into something
standard for the graphQL client
cache.
HTGrenoble Février 2019 - @sabativi
25. Whathappens
· I make a query -> results arrived.
· It is transformed to fit into graphQL client cache
· JS thread ( can be ) blocked while doing so.
· No new UI rendering possible, UI is
unresponsive.
· CPU spike -> battery melt away.
HTGrenoble Février 2019 - @sabativi
26. Conclusion
· Open Source is not the problem
· I am
· I did not manage to keep the project as simple
as I first wanted.
· API was also a badly designed.
HTGrenoble Février 2019 - @sabativi