Slide 1

Slide 1 text

Where art thou, my error? @alloy - artsy.net h"ps:/ /github.com/alloy/graphql-finland

Slide 2

Slide 2 text

S"ll early days

Slide 3

Slide 3 text

S"ll early days

Slide 4

Slide 4 text

!

Slide 5

Slide 5 text

Errors vs Errors

Slide 6

Slide 6 text

GraphQL Errors

Slide 7

Slide 7 text

GraphQL Errors

Slide 8

Slide 8 text

Excep&ons

Slide 9

Slide 9 text

What’s the problem?

Slide 10

Slide 10 text

Par$al data

Slide 11

Slide 11 text

Par$al data

Slide 12

Slide 12 text

Par$al data

Slide 13

Slide 13 text

Par$al data

Slide 14

Slide 14 text

Par$al data

Slide 15

Slide 15 text

Communicate error

Slide 16

Slide 16 text

Communicate error

Slide 17

Slide 17 text

Possible solu*ons

Slide 18

Slide 18 text

GraphQL Errors and reject en*re response h"ps://u.nu/atrh h"ps://u.nu/pjv-

Slide 19

Slide 19 text

GraphQL Errors with metadata h"ps://u.nu/r5-2

Slide 20

Slide 20 text

GraphQL Errors with metadata

Slide 21

Slide 21 text

GraphQL Errors with metadata While convenient, the weakness of this approach is that the format of the valida6on error messages is not captured by your schema, making it bri;le to changes. Unless you maintain 6ght control of both server and client, you should keep the error responses as simple as possible. For muta6ons, it can be worthwhile defining these valida6on errors as first class ci6zens within your schema.

Slide 22

Slide 22 text

Extra (muta*on) error fields h"ps://u.nu/th7y

Slide 23

Slide 23 text

Extra (muta*on) error fields

Slide 24

Slide 24 text

Extra (muta*on) error fields h"ps://u.nu/th7y

Slide 25

Slide 25 text

Extra error field & type h"ps://u.nu/-3pw

Slide 26

Slide 26 text

Extra error field & type

Slide 27

Slide 27 text

Extra error field & type

Slide 28

Slide 28 text

Extra error field & type h"ps://u.nu/-3pw Side-note: h"ps://u.nu/i0yg

Slide 29

Slide 29 text

Recap •Use GraphQL •In context •All opera5ons •Explicit status

Slide 30

Slide 30 text

Excep&ons as first-class ci+zens

Slide 31

Slide 31 text

Excep&ons as first-class ci+zens

Slide 32

Slide 32 text

Excep&ons as first-class ci+zens

Slide 33

Slide 33 text

Excep&ons as first-class ci+zens

Slide 34

Slide 34 text

Excep&ons as first-class ci+zens

Slide 35

Slide 35 text

How we use it

Slide 36

Slide 36 text

Types

Slide 37

Slide 37 text

Types

Slide 38

Slide 38 text

Types

Slide 39

Slide 39 text

Types

Slide 40

Slide 40 text

Types

Slide 41

Slide 41 text

Types Side-note: h,ps://u.nu/c1ye

Slide 42

Slide 42 text

Field naming ‘something’ or error

Slide 43

Slide 43 text

Field naming

Slide 44

Slide 44 text

Field naming

Slide 45

Slide 45 text

Field naming

Slide 46

Slide 46 text

Downside of union

Slide 47

Slide 47 text

Downside of union Side-note: h,ps://u.nu/c29p

Slide 48

Slide 48 text

Example of query usage

Slide 49

Slide 49 text

Example of muta-on usage

Slide 50

Slide 50 text

Final thoughts !

Slide 51

Slide 51 text

Final thoughts ! @alloy

Slide 52

Slide 52 text

Final thoughts !"#

Slide 53

Slide 53 text

Final thoughts …to ‘REST’

Slide 54

Slide 54 text

@alloy artsy.net h"ps:/ /github.com/ alloy/graphql-finland