Prevent breaking production with GraphQL + TypeScript
Carlos Rufo / 14-11-2019 / API Days London π¬π§ 2019
π I'm Carlos
@swcarlosrj
Software π» Consultant
GraphQL ππ° Organizer
SpaceX π GraphQL API
Agenda
π WHW GraphQL
π GraphQL + TypeScript
π
Live Coding
WHW π
GraphQL
What π€©
Specification
βQuery Language
Features
Specification
β It's not a library
β It's not a framework
β It's a specification
Is a language-agnostic
specification to build APIs
C# / .NET
,
Clojure
,
Elixir
,
Erlang
,
Go
,
Groovy
,
Java
,
JavaScript
,
PHP
,
Python
,
Scala
,
Ruby
Query Language
β It's not a library
β It's not a framework
β It's a
Graph Query Language
specification
Features
π Strongly Typed
π Introspectable
π Queries, Mutations & Subscriptions
π Transport agnostic
β»οΈ Efficient & Reusable
β‘οΈ Product development
How π§
π Live
Coding
Why π€
Efficiency
Docs
Tooling
Type System
Efficiency
Overfetching
Underfecthing
β οΈ Common issues in current APIs
Overfetching
"Fetch
more
data
that the client
actually needs"
Ask for what you need,
get exactly that π
Underfetching
Ask for multiple resources,
get all of that π
"Fetch
not enough
data that the client
actually needs"
Docs
Auto-Generated
Typed
Up-to-Date
Β
It'd be π₯
Tooling
Move faster with
powerful dev tools πΉ
In-browser API IDE
Auto-Gen Types
IDEs extensions
Type System
Type System
Explore your API β¨
GraphQL π
TypeScript
TypeScript
Typed superset
Β of JavaScript that compiles to plain JavaScript
TypeScript & GraphQL
Starts and ends with
Β
JavaScript
Strong tools for large apps
State of the art JavaScript
Introspect your API with GraphQL,
introspect your code with TS
Single Source of Truth
Type Generators
Auto-generate
Β
types
based
on your GraphQL implementation
Live coding
π π π
Agenda
Exploring π Codebase
GraphQL π Servers
GraphQL π Clients
SpaceX APIs
Links
π
api.spacex.land/graphql
π°
api.spacex.land/rest
Check & contribute
github.com/spacexland
Slides
Thanks π¬π§
@swcarlosrj
Made with Slides.com