Hands On - Building your first GraphQL API
“GraphQL is a query language for your API, and a
server-side runtime for executing queries by using a
type system you define for your data.”
SQL
GraphQL Language
Express, Spring Boot or any REST framework
GraphQL Runtime
● Open-source project maintained by Facebook
● An REST alternative
● You ask for what you need, get exactly that
● Get many resources in a single request
● Describe what’s possible with a type system
● Used by GitHub, Coursera, Twitter, Shopify...
What is that?
Why we need this?
● Database independence
● API translate/middleware
● Easily plug into your existing code
● You define your types and fields
● Evolve your API without versions
● Self-documented
Show me the code!
package.json
json-server
server.js
schema.js
Customer Type
Root Query Object
your “/” endpoint
GraphiQL IDE
Relationships and Mutations
Ecosystem Support
github.com/graphql/graphql-js
github.com/graphql-java/graphql-java
...
More Examples
funfun function
/watch?v=lAJWHHUz8_8
/watch?v=RMtq0RCLuzs
github.com/brenohq/graphql-server
The End

Hands On - GraphQL