SlideShare a Scribd company logo
1 of 39
Download to read offline
Navigating Your
Transition to GraphQL
A GraphQL-first approach to improving your API
Sashko Stubailo
Tech Lead
Apollo Open Source
Danielle Man
Developer
Apollo Services
Who are we?
• We build and maintain tools for the
GraphQL community
• Excited about the developer experience
enabled by GraphQL
• We went from 0 to GraphQL in two
production apps, talked to many people
who did the same
• We build new apps and features fast
with a GraphQL-first workflow
apollodata.com
github.com/apollostack
Announced and
open-sourced
July 2015
Production ready,
new site
September 2016
Great tools, best
practices, efficient
workflow
The future
Initial design at
Facebook
2012
Looking back…
GraphQL First Development
Post
User
Comment
1. Design API schema
Contract between frontend and
backend with a shared schema
language
2. Build UI and backend
Parallelize with mocking,
develop component-based UIs
with GraphQL containers
3. Run in production
Static queries make loading
predictable, schema tells you
which fields are being used
query Human
Design your schema1
• Database schema is not
always relevant to frontend
developers
• Apps are getting more
complex, not all of your
data is in a database!
D B S C H E M A
• Contract between frontend and
backend
• Declares relationships across
backend data sources
• Incrementally adopt - get the
API you always wanted!
# A comment submitted by a user
type Comment {
# The SQL ID of this comment
id: Int!
# The GitHub user who posted the comment
postedBy: User!
# The text of the comment
content: String!
# The repository which this comment is about
repoName: String!
}
G R A P H Q L S C H E M A
GraphQL requests Backend fetches
Incremental GraphQL Adoption
Data-Layer Redesign
Combine Queries
Simplify Development
Thousands of active users
Galaxy
Client
Elastic Search MongoDB
Amazon Dynamo
DB
C L I E N T
A W S
Galaxy Server
Apollo Client
GraphQL Server
GraphQL from the Beginning
Schema Contract
Parallelize Development
Schema Ownership?
Built from scratch in under 3 months
Optics
B A C K E N D F R O N T E N D
Design for different types of apps
Don’t overfit to specific features Computed fields live on the server
Components ask for exactly
what they need
Generic Backend-for-
Streamline your Workflow
2
B U I L D I N G A P P S
Product Design Engineering
R E A L I T Y
I D E A L
Change database
Rewrite mocked data for all
endpoints using it
Change schema
Update one resolver
P E R - E N D P O I N T P E R - R E S O L V E R
Rest Mocking GraphQL Mocking
Component-
First
Development
1. Painlessly adapted to schema changes
2. Connected front-end to back-end in under 2 days
3. Developed full app in less than 3 months
O U R E X P E R I E N C E
graphql-tools
20 contributors - thanks @DxCx,
@sebastienbarre, @nicolaslopezj
Implement a Node.js GraphQL
schema using the schema
language directly, with support
for all GraphQL features
github.com/apollostack/graphql-tools
graphql-tools
One-step data mocking based on
schema types, customizable as
much as you need.
Instrumental to GraphQL First
development workflow.
github.com/apollostack/graphql-tools
graphql-tools
github.com/apollostack/graphql-tools
Find new workflows
Managing GraphQL Development At Scale - Nick Nance
Develop new features together
Pull request by @itajaja
Load Data with Queries 3
GraphQL clients
Plain fetch
Simple
Predictable
No UI consistency and performance
features
Caching client
Some work required to set up and learn
Easy to update the UI
Manage data in one place
Great dev tools
GET
Incremental adoption for the client
Compatible
Works with your existing client-
side infrastructure
Un-opinionated
Design your own schema, fit
into your existing data model
Component-first
Use GraphQL just one
component at a time, test and
reuse components
Post
User
Comment
Static queries for perf and security
• Use fragments for static composition.
• Queries sent to the server are predictable,
and can be optimized.
• Data requirements of app can be fully
analyzed at build time.
• Better security with persisted queries.
Write your data requirements so that
tooling can separate them from your UI
code
Code generation for result types
Write GraphQL queries
Get static typing based on schema
• Fully featured in Apollo-iOS today
• Community working on TypeScript and
Flow on apollo-codegen
• Work with the easy to learn GraphQL
query language, get all of the benefits of
native integration
github.com/apollostack/apollo-ios
github.com/apollostack/apollo-codegen
Big thanks to @rricard for working on TS
and Flow!
Apollo Client 0.5
dev.apollodata.com
Out today, big thanks to over 100 contributors, especially @jbaxleyiii,
@rricard, @johnthepink, @abhiaiyer91, @kamilkisiela
Apollo Client 0.5
• 100% GraphQL spec support: if you can type it in GraphiQL, it will work.
• Fully featured: Queries, mutations, fragments, optimistic UI, pagination, and more.
• Tooling friendly: Redux dev tools, static analysis, and persisted queries.
• Compatible: Use it with React, React Native, Angular 1, Angular 2, Vue.js, etc.
• Flexible and customizable: Fits into any architecture, customizable caching.
• Futuristic: Subscriptions and custom resolvers, ideas coming from the community.
The best part is — it’s just GraphQL.
GraphQL client conclusions
Use a caching client
Get better UI consistency and avoid loading data you already have.
Incremental adoption and compatibility
Important as you move older apps over to GraphQL, and if your tech choices change.
Static queries
Predictable loading, better dev tools, clearer server insights, eventually move to
persisted queries for performance and security.
Monitor in Production 4
1. Understand endpoint usage
2. Measure endpoint timing
3. Monitor server load
W H A T D O Y O U W A N T ?
……..
Performance
1. Know exactly what fields are used and how
2. Measure field resolver performance
3. Detect breaking schema changes
……..
W H A T C A N Y O U G E T ?
Performance
apollodata.com/optics
Execution traces
Field latencies
Field usage
Optics
GraphQL-First workflow
Design your schema
Implement UI and backend in parallel
Get fine-grained production understanding
Sashko Stubailo
Apollo Open Source
@stubailo
Danielle Man
Apollo Services
@danimman
Huge thanks to the open source community!
Know anyone who wants to work on GraphQL
technology full time? We’re hiring!

More Related Content

Recently uploaded

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Recently uploaded (20)

Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Navigating your transition to GraphQL with GraphQL first development

  • 1. Navigating Your Transition to GraphQL A GraphQL-first approach to improving your API Sashko Stubailo Tech Lead Apollo Open Source Danielle Man Developer Apollo Services
  • 2. Who are we? • We build and maintain tools for the GraphQL community • Excited about the developer experience enabled by GraphQL • We went from 0 to GraphQL in two production apps, talked to many people who did the same • We build new apps and features fast with a GraphQL-first workflow apollodata.com github.com/apollostack
  • 3. Announced and open-sourced July 2015 Production ready, new site September 2016 Great tools, best practices, efficient workflow The future Initial design at Facebook 2012 Looking back…
  • 4. GraphQL First Development Post User Comment 1. Design API schema Contract between frontend and backend with a shared schema language 2. Build UI and backend Parallelize with mocking, develop component-based UIs with GraphQL containers 3. Run in production Static queries make loading predictable, schema tells you which fields are being used query Human
  • 6. • Database schema is not always relevant to frontend developers • Apps are getting more complex, not all of your data is in a database! D B S C H E M A
  • 7. • Contract between frontend and backend • Declares relationships across backend data sources • Incrementally adopt - get the API you always wanted! # A comment submitted by a user type Comment { # The SQL ID of this comment id: Int! # The GitHub user who posted the comment postedBy: User! # The text of the comment content: String! # The repository which this comment is about repoName: String! } G R A P H Q L S C H E M A
  • 9. Incremental GraphQL Adoption Data-Layer Redesign Combine Queries Simplify Development Thousands of active users Galaxy
  • 10. Client Elastic Search MongoDB Amazon Dynamo DB C L I E N T A W S Galaxy Server Apollo Client GraphQL Server
  • 11. GraphQL from the Beginning Schema Contract Parallelize Development Schema Ownership? Built from scratch in under 3 months Optics
  • 12. B A C K E N D F R O N T E N D Design for different types of apps Don’t overfit to specific features Computed fields live on the server Components ask for exactly what they need Generic Backend-for-
  • 14. B U I L D I N G A P P S Product Design Engineering
  • 15. R E A L I T Y
  • 16. I D E A L
  • 17. Change database Rewrite mocked data for all endpoints using it Change schema Update one resolver P E R - E N D P O I N T P E R - R E S O L V E R Rest Mocking GraphQL Mocking
  • 19.
  • 20. 1. Painlessly adapted to schema changes 2. Connected front-end to back-end in under 2 days 3. Developed full app in less than 3 months O U R E X P E R I E N C E
  • 21. graphql-tools 20 contributors - thanks @DxCx, @sebastienbarre, @nicolaslopezj Implement a Node.js GraphQL schema using the schema language directly, with support for all GraphQL features github.com/apollostack/graphql-tools
  • 22. graphql-tools One-step data mocking based on schema types, customizable as much as you need. Instrumental to GraphQL First development workflow. github.com/apollostack/graphql-tools
  • 23. graphql-tools github.com/apollostack/graphql-tools Find new workflows Managing GraphQL Development At Scale - Nick Nance Develop new features together Pull request by @itajaja
  • 24. Load Data with Queries 3
  • 25. GraphQL clients Plain fetch Simple Predictable No UI consistency and performance features Caching client Some work required to set up and learn Easy to update the UI Manage data in one place Great dev tools GET
  • 26. Incremental adoption for the client Compatible Works with your existing client- side infrastructure Un-opinionated Design your own schema, fit into your existing data model Component-first Use GraphQL just one component at a time, test and reuse components Post User Comment
  • 27. Static queries for perf and security • Use fragments for static composition. • Queries sent to the server are predictable, and can be optimized. • Data requirements of app can be fully analyzed at build time. • Better security with persisted queries. Write your data requirements so that tooling can separate them from your UI code
  • 28. Code generation for result types Write GraphQL queries Get static typing based on schema • Fully featured in Apollo-iOS today • Community working on TypeScript and Flow on apollo-codegen • Work with the easy to learn GraphQL query language, get all of the benefits of native integration github.com/apollostack/apollo-ios github.com/apollostack/apollo-codegen Big thanks to @rricard for working on TS and Flow!
  • 29. Apollo Client 0.5 dev.apollodata.com Out today, big thanks to over 100 contributors, especially @jbaxleyiii, @rricard, @johnthepink, @abhiaiyer91, @kamilkisiela
  • 30. Apollo Client 0.5 • 100% GraphQL spec support: if you can type it in GraphiQL, it will work. • Fully featured: Queries, mutations, fragments, optimistic UI, pagination, and more. • Tooling friendly: Redux dev tools, static analysis, and persisted queries. • Compatible: Use it with React, React Native, Angular 1, Angular 2, Vue.js, etc. • Flexible and customizable: Fits into any architecture, customizable caching. • Futuristic: Subscriptions and custom resolvers, ideas coming from the community. The best part is — it’s just GraphQL.
  • 31. GraphQL client conclusions Use a caching client Get better UI consistency and avoid loading data you already have. Incremental adoption and compatibility Important as you move older apps over to GraphQL, and if your tech choices change. Static queries Predictable loading, better dev tools, clearer server insights, eventually move to persisted queries for performance and security.
  • 33. 1. Understand endpoint usage 2. Measure endpoint timing 3. Monitor server load W H A T D O Y O U W A N T ? …….. Performance
  • 34. 1. Know exactly what fields are used and how 2. Measure field resolver performance 3. Detect breaking schema changes …….. W H A T C A N Y O U G E T ? Performance
  • 35.
  • 36.
  • 38. GraphQL-First workflow Design your schema Implement UI and backend in parallel Get fine-grained production understanding
  • 39. Sashko Stubailo Apollo Open Source @stubailo Danielle Man Apollo Services @danimman Huge thanks to the open source community! Know anyone who wants to work on GraphQL technology full time? We’re hiring!