Fireship · @fireship
GraphQL Basics - Build an app with the SpaceX API
Uploaded October 9, 2019 · Length 15:48
Summary
Learn GraphQL basics by building an app with the SpaceX API, covering queries, types, and mutations.
- graphql basics
- space x api
- graphql queries
- graphql types
- graphql mutations
- apollo client
- graphql tutorial
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
graph QL a query language for AP is you
- 0:03
define a schema for your data then tell
- 0:05
graph QL how to fetch and supply that
- 0:07
schema and in doing so amazing things
- 0:09
might happen as we'll see in this video
- 0:10
and 9 ignition sequence start in today's
- 0:15
video you'll learn the fundamental
- 0:17
concepts of graph QL by interacting with
- 0:19
the public space X API if you're new
- 0:21
here like and subscribe and I'd like to
- 0:23
give a special thanks to Arjun ulam and
- 0:25
Shelley who is the mastermind behind
- 0:26
this video if you're looking for a graph
- 0:28
QL expert you can find his LinkedIn and
- 0:30
github in the description below let's
- 0:32
start by answering the question of what
- 0:34
is graph QL in the most basic sense it's
- 0:36
a language that allows your front-end
- 0:38
applications to communicate with your
- 0:40
back-end applications a rosetta stone if
- 0:42
you will a consistent way for your
- 0:44
front-end to request data from your
- 0:45
back-end despite any differences in the
- 0:47
underlying programming language for
- 0:49
example you're a mobile application
- 0:50
might need to request a sandwich from
- 0:53
your API it can make that request by
- 0:55
sending a graph QL query the query will
- 0:58
have the same shape that you expect to
- 0:59
receive back from the API as JSON so in
- 1:02
this case we expect a sandwich object
- 1:04
with bread ham and cheese on the server
- 1:07
graph QL also functions as a runtime for
- 1:09
executing queries the server defines
- 1:11
types for the data that's available
- 1:13
there and also resolvers to actually
- 1:15
fetch the data from a database or some
- 1:17
other data source now because everything
- 1:19
on the server is strongly typed we can
- 1:21
get some really amazing tooling with
- 1:23
graph QL to demonstrate this let's head
- 1:25
over to the graph QL Explorer for the
- 1:27
public space X API if you're the
- 1:29
consumer or using the API in your
- 1:31
front-end application you can do
- 1:32
introspection to the backend to see what
- 1:34
data is available there as you can see
- 1:36
here we have a whole bunch of different
- 1:38
checkboxes that represent different
- 1:39
queries we can make to the space X API
- 1:42
in the middle panel we already have an
- 1:44
example graph ul query ready to go now
- 1:46
go ahead and hit the play button to
- 1:48
execute the query and then you'll see on
- 1:49
the right side we get a JSON payload
- 1:51
returned from the server and what you'll
- 1:53
notice is that the properties on this
- 1:55
JSON object are identical to the way we
- 1:57
structured them in our graph QL query
- 1:59
and on top of that everything is


