Fireship · @fireship
GraphQL with Apollo Server 2.0
Uploaded June 14, 2018 · Length 9:34
Summary
Learn how to build a GraphQL API from scratch using Apollo Server 2.0 and Node.js, with a focus on setting up a backend API and consuming it with Angular.
- graphql
- apollo server
- nodejs
- typescript
- firebase
- firestore
- graphql api
- backend development
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
[Music]
- 0:06
one of the big predictions people are
- 0:08
making in 2018 is that graph QL will
- 0:10
make restful api is obsolete in today's
- 0:13
episode we'll learn how to build a graph
- 0:14
QL API from scratch using Apollo server
- 0:17
2.0 and node KS if you're new here make
- 0:20
sure to LIKE and subscribe and I want to
- 0:21
send a huge thank you out to Arjun
- 0:23
yellow man celli he's the mastermind
- 0:25
behind the code in this video and if you
- 0:26
need a talented developer in Denver he
- 0:28
comes highly recommended so let's kick
- 0:30
things off by talking about graph QL
- 0:32
from a very high level imagine you have
- 0:34
an angular app that communicates with a
- 0:36
bunch of different back-end data sources
- 0:38
traditionally you would do this with
- 0:39
either a REST API or a client-side SDK
- 0:42
when you hit a restful endpoint it's the
- 0:44
server that determines the shape of the
- 0:46
data that gets sent back to the client
- 0:48
what happens is that you'll hit a rest
- 0:49
one point and it will respond with a
- 0:51
bunch of data that you don't know
- 0:52
anything about and that you don't need
- 0:54
graph QL is a query language that solves
- 0:56
this problem by sitting in between your
- 0:58
back-end and front-end it allows the
- 1:00
server to define exactly what data is
- 1:02
available and it allows the client to
- 1:04
only request the data that it actually
- 1:06
needs to provide the user experience
- 1:08
what's really cool is that you can use
- 1:10
it with any back-end data source and
- 1:11
this video will use fire store and set
- 1:13
up a node J a server with Apollo to
- 1:15
deliver the API this video is a two part
- 1:18
series in this first installment we will
- 1:20
set up the back-end API and in the
- 1:22
second part we will use angular to
- 1:24
consume this API from the front end when
- 1:27
you set up a graph QL API it provides
- 1:29
this really nice playground that you can
- 1:31
use to start sending requests and this
- 1:33
just works out of the box what we're
- 1:35
going to do in the code is set up
- 1:36
interfaces that describe the data that's
- 1:38
available on the server this is super
- 1:40
powerful because the client can probe
- 1:42
the backend in advance to find out what
- 1:44
types are available and how they can be
- 1:46
requested this means you get amazing
- 1:48
developer tooling even on a foreign API
- 1:50
because you know exactly what's
- 1:52
available and how it can be requested
- 1:54
you can see here I requested all the
- 1:56
interface names and the ones we're
- 1:58
interested in our tweet and user let's


