1 of 21

GraphQL on the Edge

A shield for your app

Mike Fix

2 of 21

3 of 21

Normalize

Sanitize

Verify

4 of 21

(902)-226-3784

<script src=" ">

new Date('2017-10')

`+19022263784`

`null`

`1506816000000`

Application

5 of 21

`npm i -S gnt`

GraphQL Normalized Types

Simple

Consistent

Reliable

6 of 21

XSS Safe Type

Human Name

...

The Future

7 of 21

The Future

Email

CVV

Cent

Address

Country

Blood Type

Good Password

CSS Color

HTML Tag

Currencies

MIME Type

File

Max String

SQL Safe

URL

IP Address

Glob String

Airport

8 of 21

Testing at the Edge

9 of 21

  • Dan Abramov

Source: https://hashnode.com/post/what-have-you-learned...

“For libraries, tests should ideally be written against the public APIs. This goes against the common mantra of unit testing, but in our experience this helps both ensure that the right thing is being tested, and that it is easy to replace the underlying implementation”

10 of 21

API Testing

11 of 21

Unit Testing!

12 of 21

Deployment, Smoke, Regression...

13 of 21

Reusability

14 of 21

Data-driven Testing

15 of 21

...only your data changes

16 of 21

...only your data changes

17 of 21

  • Dan Abramov

Source: https://hashnode.com/post/what-have-you-learned...

“For very complex code, fuzz testing may work better than unit tests. If the code you're testing has to handle many unexpected cases that are hard to predict, it might be worth writing tests in a non-deterministic manner that randomly generates inputs and asserts that the outputs satisfy certain conditions.”

18 of 21

Contact Me

{

data: {

me: {

displayName: "Michael Fix",

email: "mrfix84@gmail.com",

website: "mfix22.github.io",

socials: {

twitter: "@fixitup2",

github: "@mfix22"

}

}

}

}

19 of 21

Bonus

20 of 21

carbon.now.sh

21 of 21

  • Guillermo Rauch

Source: https://twitter.com/rauchg/status/807635649813618688

“Write tests. Not too many. Mostly integration.”