Slide 1

Slide 1 text

&

Slide 2

Slide 2 text

Chris Ball cball_

Slide 3

Slide 3 text

Disclaimers

Slide 4

Slide 4 text

vs

Slide 5

Slide 5 text

vs

Slide 6

Slide 6 text

vs

Slide 7

Slide 7 text

These are all tools to build apps.

Slide 8

Slide 8 text

You are not your tools.

Slide 9

Slide 9 text

What is GraphQL?

Slide 10

Slide 10 text

A specification that enforces a schema.

Slide 11

Slide 11 text

The schema validates
 client requests.

Slide 12

Slide 12 text

An application layer.

Slide 13

Slide 13 text

Gives power to
 the client.

Slide 14

Slide 14 text

What?!

Slide 15

Slide 15 text

Here’s a schema.

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

2 Special Schema Types.

Slide 18

Slide 18 text

Query

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

Mutation

Slide 21

Slide 21 text

Variables!

Slide 22

Slide 22 text

GraphQL Advantages

Slide 23

Slide 23 text

Advantages ★ No more “hey can you make this endpoint
 return this now?” discussions ★ Reduce number of requests ★ Smaller payloads (return only what you need) ★ camelCase conventions ★ Client determines shape of response ★ Subscriptions / websockets built in

Slide 24

Slide 24 text

Advantages ★ “Wrap” an existing REST API ★ Schema Stitching to combine multiple GQL APIs as one ★ No more thinking about requests/responses ★ Tooling: GraphiQL is amazing ★ Introspection: Client can send query to get the schema ★ Fragments

Slide 25

Slide 25 text

GraphiQL & Introspection

Slide 26

Slide 26 text

Ok, how can I use this in Ember?

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

I was going to show examples using

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

Configure Apollo

Slide 33

Slide 33 text

Do some queries

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

How do I fetch a different org?

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

Cool story. How do you query 
 for multiple items?

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

Do a mutation

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

Subscriptions
 are also a thing.

Slide 51

Slide 51 text

Ember Data?

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

What about Tests / Mocking / Mirage?

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

https://github.com/bgentry/ember-apollo-client/blob/master/tests/helpers/start-pretender.js https://www.apollographql.com/docs/link/links/schema.html#Mocking

Slide 56

Slide 56 text

Different Folder Structure?

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

https://github.com/bgentry/ember-apollo-client/blob/master/tests/helpers/start-pretender.js https://www.apollographql.com/docs/link/links/schema.html#Mocking

Slide 59

Slide 59 text

Resources

Slide 60

Slide 60 text

https://github.com/bgentry/ember-apollo-client http://graphql.org/learn/ https://www.apollographql.com/docs http://graphql.org/blog/rest-api-graphql-wrapper/ https://www.howtographql.com/ember-apollo