SlideShare uma empresa Scribd logo
1 de 95
The new "Lingua Franca" for API Development
"What you want is what you get"
About.Me/mhunger
Michael Hunger
(Director of) Developer Relations Engineering,
Neo4j
jexp.de/blog | @mesirii | github.com/jexp
I'm no expert in RESTful API design,
development and deployment.
If in doubt ask the experts, like Stefan, Oliver,
Jim, Ian, ...
I did a decent share of GraphQL though.
You ?
Have you heard of GraphQL?
Have you used GraphQL?
Did you attend the talks from Lars Röwekamp
or Manuel Mauky at OOP?
Some wise Words on Choosing an API Style
• Context matters
• API design styles are just tools
• Make an informed choice
• Choice will affect many aspects
(impl, dev-experience, lifecycle)
https://apihandyman.io/and-graphql-for-all-a-few-things-to-think-about-before-blindly-dumping-rest-for-graphql/
Ways to Build Remote APIs
API Design Styles
(by Manuel Mauky)
Remote API Techniques
•RPC (gRPC, CORBA)
•WS-* (SOAP)
•Publish / Subscribe
•Streaming Events (Kafka, Event Store)
•REST
•GraphQL
What?
What is GraphQL ?
GraphQL is an API query language
The "Graph" is the application domain model
Specification & Reference Implementation
Expressive, extensible nested expressions
What is GraphQL not?
GraphQL is not a (graph) database query language
GraphQL is not a RESTful API
GraphQL is not a Silver Bullet
Why?
Why GraphQL?
We were frustrated with the differences between the data we
wanted to use in our apps and the server queries they
required.
GraphQL was our opportunity to rethink mobile app data-
fetching from the perspective of product designers and
developers.
It moved the focus of development to the client apps, where
designers and developers spend their time and attention.
GraphQL, a data query language. Post by Lee Byron
Origins
GraphQL - Origins?
•Facebook 2012
• efficient queries for
mobile clients
• minimize latency &
roundtrips
• "get what you need"
• pragmatic development
• Open Sourced 2015
• Language Specificiation
• Reference Implementation
• Quickly Growing Community
• esp. in Javascript (React)
• but also in backends
• Developer Tooling
• Working Group for Spec
Example
Conference - App
Conference – App: Listing
{ onDay(day: Mi) {
id
title
speaker { name }
track { name }
slot {
start, time }
}}
Conference - Result
{[
{ id: "98a8ad", title: "Refactoring ..."
speaker: [{ name: "Oliver Gierke" }]
track: {name: "Modern Architecture"}
slot: {start: 9:00, time: 60}
},
...
]}
Conference – App: Details
{ talk(id:"98a8ad") {
id, title
speaker { name, pic }
track { name }
slot {
start, time, date}
abstract, text,
audience, level, req
}}
Conference - Result
{[{ id: "98a8ad", title: "Refactoring ..."
speaker: [{ name: "Oliver Gierke",
pic: "http://..." }]
track: {name: "Modern Architecture"}
slot: {start: 9:00, time: 60, date: ".."}
text: "", level: "Expert", req: "DDD..."
}
]}
Reuse Retrieved Data
{ talk(id: "Mi 1.1") {
id, title
speaker { name, pic }
track { name }
slot {
start, time, date}
abstract, text,
audience, level, req
}}
Conference - Schema
type Talk {
id: ID!
title: String!
abstract: String
speaker: [Person!]!
slot: Slot!
audience, level, ..
}
type Person {
email: ID!
name: String!
talks: [Talk]
}
type Slot {
day: Day
start: Time
}
Conference - Schema
type TalkMutations {
rate(id:ID!, rating:Int, comment:String)
: Talk
}
schema {
mutations: TalkMutations
}
Conference - Mutation
mutation rate(id:2342,rating:5,
comment:"Really useful") {
title
speaker {
name
}
}
Conference - Result
{
title: "Cloud Native Java",
speakers: [{
name: "Josh Long"
}]
}
GraphiQL Query Tool
OOP Demo
Takeaway - The Essence of GraphQL:
Strict, typed schema
enables
flexible, safe Queries
Goals
Goals
• Developer productivity
• Focus on Front-End needs
• Enable Tool Building
• Fast Validation
• Clear Communication
What issues wants GraphQL to solve?
• one shape of resource vs. many different needs
• custom shape of data query
• type safe and valid
• latency & roundtrips
• updates as commands, http verbs not expressive enough
• language for communication between teams
• front-end & back-end can develop independently
• better developer tooling
Design Principles
Design Principles
•Hierarchical
•Product Centric (front-end)
•Introspective
•Strong Typing
•Client‐specified queries
Design Principles
• a language used to query application servers that have
capabilities defined in this specification
• does not mandate a particular programming language
or storage system
• map capabilities to a uniform language, type system, and philosophy
• unified interface friendly to product development
and a powerful platform for tool‐building
Specification
What is GraphQL Spec ?
• Formal language specification for schema & operations
• Developed by Working Group
• at Facebook
• collaborates with community
• Published (regularly) after updates
• Reference Implementation (JavaScript)
http://facebook.github.io/graphql/ http://graphql.org/learn/
What is in the GraphQL Spec ?
• Schema
• Types
• Query Language
• Mutations
• Subscriptons
• Extensibility
• Parameters
• Expected behavior
• Fragments
• Results & Errors
• No prescribed transport
• Mostly HTTP (GET or POST)
http://facebook.github.io/graphql/ http://graphql.org/learn/
Specification
Example
github.com/sogko/graphql-schema-language-cheat-sheet
Types
• Object Types
• Unions
• Interfaces
• Input Typ
• Enums
• Scalar Types
• Built-In:
Int, Float, String, Boolean, ID
• Nullability
• Arrays
https://github.com/sogko/graphql-schema-language-cheat-sheet
Query
http://facebook.github.io/graphql/ http://graphql.org/learn/
schema {
query: QueryType
}
type QueryType {
talksOnDay(day:Day) [Talk] @cached
}
Mutation
http://facebook.github.io/graphql/ http://graphql.org/learn/
schema {
mutation: TalkUpdates
}
type TalkUpdates {
rate(talk:Talk, rating:Int) Talk
}
Mutation
http://facebook.github.io/graphql/ http://graphql.org/learn/
input type RatingInput {
talk: Talk
rating: Int
}
type TalkUpdates {
rate(rating:RatingInput) Talk
}
Subscriptions
type ConferenceSubscription {
talkUpdated(track: String!): TalkUpdate
}
schema {
subscription: ConferenceSubscription
}
https://www.apollographql.com/docs/graphql-subscriptions/subscriptions-to-schema.html
Subscriptions
subscription {
talkUpdated(track: "Moderne Architektur") {
id
title
speaker { name }
slot { start, duration }
}}
https://www.apollographql.com/docs/graphql-subscriptions/subscriptions-to-schema.html
Subscriptions
•Mutations trigger Domain Events
•explicit or implicit
•Domain Event triggers Subscription update
•Websocket or HTTP transport / PubSub
•Supported in Clients
https://dev-blog.apollodata.com/tutorial-graphql-subscriptions-server-side-e51c32dc2951
Directive
http://facebook.github.io/graphql/ http://graphql.org/learn/
type Talk {
speaker: [Person] @relation
(name:'PRESENTED',direction:OUT)
duration: Int @deprecated
}
Others
• (named) Fragments
• Union, Interfaces, Enum
• Params with defaults
• Variables
• Aliases
• Multiple Operations
Execution
Executing GraphQL Requests
1. parse (syntax)
2. validate (semantics)
3. execute
1. resolve fields
2. combine results
4. return result or errors
new concept
Field Resolver + Data Fetcher
possibly multiple operations per request
SQL
NOSQL
Static
REST
GraphQL
ServerGraphQL
Schema
FieldResolver+DataFetcher
Parse
Validate
Merge
Results
computed
Transport & Auth
GraphQL Transport
• Not prescribed
• Most often HTTP on /graphql
• POST or GET
• Hard to cache
• HTTP 200 with inline errors
• Monitoring / Tracing by middleware
GraphQL Auth
• In GraphQL server
• In Middleware before
• In Field resolver
• Use of directives @allowed(roles: [Admin])
SQL
NOSQL
Static
REST
computed
GraphQL
Server
Mobile Apps
SPA (React, Ang, Vue)
API Consumers
End Users
Any Language / Platform
Middle
ware
Cache
Aggregator
Cache
Aggregator
Cache
Aggregator
Development
GraphQL Development
1. Schema First – Agree on first iteration of schema
2. Register Schema
3. Implement Type Resolver
4. Fetch Data (static, db, api)
5. Implement Client App view with GraphQL client library
6. Iterate
Uses
GraphQL Uses
Larger Companies
• Consolidate sprawling APIs
• API domain language
• API Facades (Schema stitching)
• Wrap data sources & APIs
• Automatic API documentation
• API monitoring
• API evolution
Anyone (esp. Startups)
• Webapp development
• Mobile app development
• Quick Prototyping
• GraphQL as a service
DDD
GraphQL and Domain Driven Design
Users
Introspection
Introspection
{ __type(name:"Talk") {
name
fields {
name
description
}}}
• in every backend
• queryable via graphql
• for validation
• type completion
• visualization
• fetching Schema SDLhttps://github.com/graphql-cli/graphql-cli
Documentation
# Conference Sessions
type Talk {
# id, e.g. Mi 3.2
id: ID!
title: String!
abstract: String
# multiple speakers
speaker: [Person!]!
}
• auto-generated from schema
• comments as docs
• browseable in client
• helpful for type completion
GraphiQL
Voyager
Tools
GraphQL DBaaS – Graph.Cool
• playground
• backed by database
• automatic mutation & query generation
• automatic field parameters
• auth
• serverless functions
• resolvers
• graph.cool / neo4j-graphql
Apollo Launchpad
Apollo Engine
GraphQL Client Libraries
•apollo (js, android, ios)
•graphql.js
•relay-modern
•...
GraphQL DB-API / DBaaS
• Prisma / GraphCool
• Join-Monster
• PostGraphQL / PostGraphile
• Neo4j-GraphQL
Schema Stitching
GraphQL Join
Apollo Link
Gramps (IBM)
GraphQL Server Libraries (graphql-*)
• JavaScript
• Java
• Scala (Sangria)
• Ruby
• Python (Graphene)
• Go
• .Net
• PHP
• ...
GraphQL Community
• GraphQL Summit
• 2016,2017,2018
• GraphQL-Europe
• 2016, 2017
• GraphQL Slack
• 4500 users
• Meetups
• 65 groups
• 23000 members
3Things I like about
Contract for a common
vocabulary
Flexible Querying
Extensibility
REST
RESTful API
• several resources, reachable via URI
• links between resources
• HTTP as protocol
• different representations / media-types, .e.g JSON
Philosophy & Guidelines
REST is software design on the scale of decades: every
detail is intended to promote software longevity and
independent evolution. Many of the constraints are
directly opposed to short-term efficiency.
- Roy Fielding
http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
Philosophy & Guidelines
I think most people just make the mistake that it should
be simple to design simple things. In reality, the effort
required to design something is inversely proportional
to the simplicity of the result. As architectural styles go,
REST is very simple.
- Roy Fielding
http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
New API Description Languages & Tools
• Not much tooling in first 5 years
• Web Service Description Language (WSDL)
• Web Application Description Language (WADL)
• Restful Service Description Language (RSDL)
• HATEOAS – Hypermedia As The Engine Of Application State
• Swagger
• RESTful API Modeling Language (RAML)
GraphQL – REST
Comparison
GraphQL REST
free operation names for queries &
mutations
HTTP Verbs
strong type safety none
operations are fields in schema Resources at URIs
model changes require schema +
query changes
no API change through model change
addtive, deprecation, monitoring versioning, tagged resources
allows introspection communicates links to operations
depending on transport, minimally uses web infrastructure
strong tooling some tooling, depending on API tool
REST Benefits
• Well understood and known
• HTTP Protocol incl. Verbs
• Web Standards
• Web Infrastructure (Caching, Auth)
• Isolated Resources
• Dynamic links / data in REST API change client behavior
REST Issues
• Most RESTful API are just HTTP APIs
• Effort for complex queries (n+1, latency)
• Overfetching, Underfetching
• Versioning
GraphQL Benefits
• Type Safety
• Schema = Contract
• No overfetching, only resolve requested fields
• Single Request
• Combining Queries / Reusing existing Results
• Good set of libraries
• Explicit Specification + Reference Implementation
• Active Community / Drivers / Tools
GraphQL Issues
• Still New / Adoption
• Filtering
• Aggregation
• Auth
• Move aggregation to server
• Caching in Server & Client
• Larger Request Sizes
• Can't change hierarchy structure
Ressources
1. graphql.org
2. howtographql.com
3. github.com/chentsulin/awesome-graphql
4. graph.cool
5. github.com/graphql-java
6. Artikel MH JS 4/2017 (github.com/jexp/javaspektrum-graphql-
demo)
Thank YOU
Questions?
@mesirii

Mais conteúdo relacionado

Mais procurados

Training Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL LibraryTraining Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL Library
Neo4j
 
05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...
05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...
05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...
Revolution Analytics
 
Training Week: Build APIs with Neo4j GraphQL Library
Training Week: Build APIs with Neo4j GraphQL LibraryTraining Week: Build APIs with Neo4j GraphQL Library
Training Week: Build APIs with Neo4j GraphQL Library
Neo4j
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
Sashko Stubailo
 

Mais procurados (20)

Training Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL LibraryTraining Series: Build APIs with Neo4j GraphQL Library
Training Series: Build APIs with Neo4j GraphQL Library
 
The 7 Deadly Sins of API Design
The 7 Deadly Sins of API DesignThe 7 Deadly Sins of API Design
The 7 Deadly Sins of API Design
 
Neo4j Data Loading with Kettle
Neo4j Data Loading with KettleNeo4j Data Loading with Kettle
Neo4j Data Loading with Kettle
 
Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016
Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016
Hadoop User Group Ireland (HUG) Ireland - Eddie Baggot Presentation April 2016
 
How Graph Databases efficiently store, manage and query connected data at s...
How Graph Databases efficiently  store, manage and query  connected data at s...How Graph Databases efficiently  store, manage and query  connected data at s...
How Graph Databases efficiently store, manage and query connected data at s...
 
Enterprise graph applications
Enterprise graph applicationsEnterprise graph applications
Enterprise graph applications
 
An intro to GraphQL
An intro to GraphQLAn intro to GraphQL
An intro to GraphQL
 
05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...
05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...
05Nov13 Webinar: Introducing Revolution R Enterprise 7 - The Big Data Big Ana...
 
The Graph-Native Advantage
The Graph-Native AdvantageThe Graph-Native Advantage
The Graph-Native Advantage
 
Better APIs with GraphQL
Better APIs with GraphQL Better APIs with GraphQL
Better APIs with GraphQL
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Training Week: Build APIs with Neo4j GraphQL Library
Training Week: Build APIs with Neo4j GraphQL LibraryTraining Week: Build APIs with Neo4j GraphQL Library
Training Week: Build APIs with Neo4j GraphQL Library
 
GraphQL Europe Recap
GraphQL Europe RecapGraphQL Europe Recap
GraphQL Europe Recap
 
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4jGraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
GraphConnect 2014 SF: How eBay and Shutl Deliver Even Faster Using Neo4j
 
Intro to GraphQL
 Intro to GraphQL Intro to GraphQL
Intro to GraphQL
 
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At CommercetoolsGraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
GraphQL Munich Meetup #1 - How We Use GraphQL At Commercetools
 
GraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits togetherGraphQL across the stack: How everything fits together
GraphQL across the stack: How everything fits together
 
Intro to Cypher
Intro to CypherIntro to Cypher
Intro to Cypher
 
The Apollo and GraphQL Stack
The Apollo and GraphQL StackThe Apollo and GraphQL Stack
The Apollo and GraphQL Stack
 
GraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer toolsGraphQL: Enabling a new generation of API developer tools
GraphQL: Enabling a new generation of API developer tools
 

Semelhante a GraphQL - The new "Lingua Franca" for API-Development

Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloud
lennartkats
 

Semelhante a GraphQL - The new "Lingua Franca" for API-Development (20)

Graphql usage
Graphql usageGraphql usage
Graphql usage
 
Delivering Developer Tools at Scale
Delivering Developer Tools at ScaleDelivering Developer Tools at Scale
Delivering Developer Tools at Scale
 
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
apidays LIVE Australia 2020 - Have your cake and eat it too: GraphQL? REST? W...
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Tutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHPTutorial: Building a GraphQL API in PHP
Tutorial: Building a GraphQL API in PHP
 
Practices and Tools for Building Better APIs
Practices and Tools for Building Better APIsPractices and Tools for Building Better APIs
Practices and Tools for Building Better APIs
 
Developing SharePoint Framework Solutions for the Enterprise (SPC 2019)
Developing SharePoint Framework Solutions for the Enterprise (SPC 2019)Developing SharePoint Framework Solutions for the Enterprise (SPC 2019)
Developing SharePoint Framework Solutions for the Enterprise (SPC 2019)
 
API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)API workshop: Introduction to APIs (TC Camp)
API workshop: Introduction to APIs (TC Camp)
 
Let's build Developer Portal with Backstage
Let's build Developer Portal with BackstageLet's build Developer Portal with Backstage
Let's build Developer Portal with Backstage
 
PHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLitePHP, the GraphQL ecosystem and GraphQLite
PHP, the GraphQL ecosystem and GraphQLite
 
2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides2.28.17 Introducing DSpace 7 Webinar Slides
2.28.17 Introducing DSpace 7 Webinar Slides
 
APIdays 2015 - The State of Web API Languages
APIdays 2015 - The State of Web API LanguagesAPIdays 2015 - The State of Web API Languages
APIdays 2015 - The State of Web API Languages
 
APIdays 2015 - The State of Web API Languages
APIdays 2015 - The State of Web API LanguagesAPIdays 2015 - The State of Web API Languages
APIdays 2015 - The State of Web API Languages
 
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
gRPC, GraphQL, REST - Which API Tech to use - API Conference Berlin oct 20
 
Hands On - GraphQL
Hands On - GraphQLHands On - GraphQL
Hands On - GraphQL
 
From Java to Ruby...and Back
From Java to Ruby...and BackFrom Java to Ruby...and Back
From Java to Ruby...and Back
 
End-to-End SPA Development using TypeScript
End-to-End SPA Development using TypeScriptEnd-to-End SPA Development using TypeScript
End-to-End SPA Development using TypeScript
 
Language Engineering in the Cloud
Language Engineering in the CloudLanguage Engineering in the Cloud
Language Engineering in the Cloud
 
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISEDEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
DEVELOPING SHAREPOINT FRAMEWORK SOLUTIONS FOR THE ENTERPRISE
 
Apache Arrow at DataEngConf Barcelona 2018
Apache Arrow at DataEngConf Barcelona 2018Apache Arrow at DataEngConf Barcelona 2018
Apache Arrow at DataEngConf Barcelona 2018
 

Mais de jexp

Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
jexp
 
Spring Data Neo4j Intro SpringOne 2012
Spring Data Neo4j Intro SpringOne 2012Spring Data Neo4j Intro SpringOne 2012
Spring Data Neo4j Intro SpringOne 2012
jexp
 

Mais de jexp (20)

Looming Marvelous - Virtual Threads in Java Javaland.pdf
Looming Marvelous - Virtual Threads in Java Javaland.pdfLooming Marvelous - Virtual Threads in Java Javaland.pdf
Looming Marvelous - Virtual Threads in Java Javaland.pdf
 
Easing the daily grind with the awesome JDK command line tools
Easing the daily grind with the awesome JDK command line toolsEasing the daily grind with the awesome JDK command line tools
Easing the daily grind with the awesome JDK command line tools
 
Looming Marvelous - Virtual Threads in Java
Looming Marvelous - Virtual Threads in JavaLooming Marvelous - Virtual Threads in Java
Looming Marvelous - Virtual Threads in Java
 
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptxGraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
GraphConnect 2022 - Top 10 Cypher Tuning Tips & Tricks.pptx
 
Neo4j Connector Apache Spark FiNCENFiles
Neo4j Connector Apache Spark FiNCENFilesNeo4j Connector Apache Spark FiNCENFiles
Neo4j Connector Apache Spark FiNCENFiles
 
How Graphs Help Investigative Journalists to Connect the Dots
How Graphs Help Investigative Journalists to Connect the DotsHow Graphs Help Investigative Journalists to Connect the Dots
How Graphs Help Investigative Journalists to Connect the Dots
 
The Home Office. Does it really work?
The Home Office. Does it really work?The Home Office. Does it really work?
The Home Office. Does it really work?
 
Polyglot Applications with GraalVM
Polyglot Applications with GraalVMPolyglot Applications with GraalVM
Polyglot Applications with GraalVM
 
Neo4j Graph Streaming Services with Apache Kafka
Neo4j Graph Streaming Services with Apache KafkaNeo4j Graph Streaming Services with Apache Kafka
Neo4j Graph Streaming Services with Apache Kafka
 
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Library
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures LibraryAPOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Library
APOC Pearls - Whirlwind Tour Through the Neo4j APOC Procedures Library
 
Refactoring, 2nd Edition
Refactoring, 2nd EditionRefactoring, 2nd Edition
Refactoring, 2nd Edition
 
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
New Features in Neo4j 3.4 / 3.3 - Graph Algorithms, Spatial, Date-Time & Visu...
 
Practical Graph Algorithms with Neo4j
Practical Graph Algorithms with Neo4jPractical Graph Algorithms with Neo4j
Practical Graph Algorithms with Neo4j
 
A Game of Data and GraphQL
A Game of Data and GraphQLA Game of Data and GraphQL
A Game of Data and GraphQL
 
Intro to Graphs and Neo4j
Intro to Graphs and Neo4jIntro to Graphs and Neo4j
Intro to Graphs and Neo4j
 
Class graph neo4j and software metrics
Class graph neo4j and software metricsClass graph neo4j and software metrics
Class graph neo4j and software metrics
 
New Neo4j Auto HA Cluster
New Neo4j Auto HA ClusterNew Neo4j Auto HA Cluster
New Neo4j Auto HA Cluster
 
Spring Data Neo4j Intro SpringOne 2012
Spring Data Neo4j Intro SpringOne 2012Spring Data Neo4j Intro SpringOne 2012
Spring Data Neo4j Intro SpringOne 2012
 
Intro to Cypher
Intro to CypherIntro to Cypher
Intro to Cypher
 
Geekout publish
Geekout publishGeekout publish
Geekout publish
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Último (20)

WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 

GraphQL - The new "Lingua Franca" for API-Development

  • 1. The new "Lingua Franca" for API Development "What you want is what you get"
  • 2. About.Me/mhunger Michael Hunger (Director of) Developer Relations Engineering, Neo4j jexp.de/blog | @mesirii | github.com/jexp
  • 3. I'm no expert in RESTful API design, development and deployment. If in doubt ask the experts, like Stefan, Oliver, Jim, Ian, ... I did a decent share of GraphQL though.
  • 4. You ? Have you heard of GraphQL? Have you used GraphQL? Did you attend the talks from Lars Röwekamp or Manuel Mauky at OOP?
  • 5. Some wise Words on Choosing an API Style • Context matters • API design styles are just tools • Make an informed choice • Choice will affect many aspects (impl, dev-experience, lifecycle) https://apihandyman.io/and-graphql-for-all-a-few-things-to-think-about-before-blindly-dumping-rest-for-graphql/
  • 6. Ways to Build Remote APIs API Design Styles
  • 8. Remote API Techniques •RPC (gRPC, CORBA) •WS-* (SOAP) •Publish / Subscribe •Streaming Events (Kafka, Event Store) •REST •GraphQL
  • 10. What is GraphQL ? GraphQL is an API query language The "Graph" is the application domain model Specification & Reference Implementation Expressive, extensible nested expressions
  • 11. What is GraphQL not? GraphQL is not a (graph) database query language GraphQL is not a RESTful API GraphQL is not a Silver Bullet
  • 12. Why?
  • 13. Why GraphQL? We were frustrated with the differences between the data we wanted to use in our apps and the server queries they required. GraphQL was our opportunity to rethink mobile app data- fetching from the perspective of product designers and developers. It moved the focus of development to the client apps, where designers and developers spend their time and attention. GraphQL, a data query language. Post by Lee Byron
  • 15. GraphQL - Origins? •Facebook 2012 • efficient queries for mobile clients • minimize latency & roundtrips • "get what you need" • pragmatic development • Open Sourced 2015 • Language Specificiation • Reference Implementation • Quickly Growing Community • esp. in Javascript (React) • but also in backends • Developer Tooling • Working Group for Spec
  • 18. Conference – App: Listing { onDay(day: Mi) { id title speaker { name } track { name } slot { start, time } }}
  • 19. Conference - Result {[ { id: "98a8ad", title: "Refactoring ..." speaker: [{ name: "Oliver Gierke" }] track: {name: "Modern Architecture"} slot: {start: 9:00, time: 60} }, ... ]}
  • 20. Conference – App: Details { talk(id:"98a8ad") { id, title speaker { name, pic } track { name } slot { start, time, date} abstract, text, audience, level, req }}
  • 21. Conference - Result {[{ id: "98a8ad", title: "Refactoring ..." speaker: [{ name: "Oliver Gierke", pic: "http://..." }] track: {name: "Modern Architecture"} slot: {start: 9:00, time: 60, date: ".."} text: "", level: "Expert", req: "DDD..." } ]}
  • 22. Reuse Retrieved Data { talk(id: "Mi 1.1") { id, title speaker { name, pic } track { name } slot { start, time, date} abstract, text, audience, level, req }}
  • 23. Conference - Schema type Talk { id: ID! title: String! abstract: String speaker: [Person!]! slot: Slot! audience, level, .. } type Person { email: ID! name: String! talks: [Talk] } type Slot { day: Day start: Time }
  • 24. Conference - Schema type TalkMutations { rate(id:ID!, rating:Int, comment:String) : Talk } schema { mutations: TalkMutations }
  • 25. Conference - Mutation mutation rate(id:2342,rating:5, comment:"Really useful") { title speaker { name } }
  • 26. Conference - Result { title: "Cloud Native Java", speakers: [{ name: "Josh Long" }] }
  • 29. Takeaway - The Essence of GraphQL: Strict, typed schema enables flexible, safe Queries
  • 30. Goals
  • 31. Goals • Developer productivity • Focus on Front-End needs • Enable Tool Building • Fast Validation • Clear Communication
  • 32. What issues wants GraphQL to solve? • one shape of resource vs. many different needs • custom shape of data query • type safe and valid • latency & roundtrips • updates as commands, http verbs not expressive enough • language for communication between teams • front-end & back-end can develop independently • better developer tooling
  • 34. Design Principles •Hierarchical •Product Centric (front-end) •Introspective •Strong Typing •Client‐specified queries
  • 35. Design Principles • a language used to query application servers that have capabilities defined in this specification • does not mandate a particular programming language or storage system • map capabilities to a uniform language, type system, and philosophy • unified interface friendly to product development and a powerful platform for tool‐building
  • 37. What is GraphQL Spec ? • Formal language specification for schema & operations • Developed by Working Group • at Facebook • collaborates with community • Published (regularly) after updates • Reference Implementation (JavaScript) http://facebook.github.io/graphql/ http://graphql.org/learn/
  • 38. What is in the GraphQL Spec ? • Schema • Types • Query Language • Mutations • Subscriptons • Extensibility • Parameters • Expected behavior • Fragments • Results & Errors • No prescribed transport • Mostly HTTP (GET or POST) http://facebook.github.io/graphql/ http://graphql.org/learn/
  • 41. Types • Object Types • Unions • Interfaces • Input Typ • Enums • Scalar Types • Built-In: Int, Float, String, Boolean, ID • Nullability • Arrays https://github.com/sogko/graphql-schema-language-cheat-sheet
  • 42. Query http://facebook.github.io/graphql/ http://graphql.org/learn/ schema { query: QueryType } type QueryType { talksOnDay(day:Day) [Talk] @cached }
  • 43. Mutation http://facebook.github.io/graphql/ http://graphql.org/learn/ schema { mutation: TalkUpdates } type TalkUpdates { rate(talk:Talk, rating:Int) Talk }
  • 44. Mutation http://facebook.github.io/graphql/ http://graphql.org/learn/ input type RatingInput { talk: Talk rating: Int } type TalkUpdates { rate(rating:RatingInput) Talk }
  • 45. Subscriptions type ConferenceSubscription { talkUpdated(track: String!): TalkUpdate } schema { subscription: ConferenceSubscription } https://www.apollographql.com/docs/graphql-subscriptions/subscriptions-to-schema.html
  • 46. Subscriptions subscription { talkUpdated(track: "Moderne Architektur") { id title speaker { name } slot { start, duration } }} https://www.apollographql.com/docs/graphql-subscriptions/subscriptions-to-schema.html
  • 47. Subscriptions •Mutations trigger Domain Events •explicit or implicit •Domain Event triggers Subscription update •Websocket or HTTP transport / PubSub •Supported in Clients https://dev-blog.apollodata.com/tutorial-graphql-subscriptions-server-side-e51c32dc2951
  • 48. Directive http://facebook.github.io/graphql/ http://graphql.org/learn/ type Talk { speaker: [Person] @relation (name:'PRESENTED',direction:OUT) duration: Int @deprecated }
  • 49. Others • (named) Fragments • Union, Interfaces, Enum • Params with defaults • Variables • Aliases • Multiple Operations
  • 51. Executing GraphQL Requests 1. parse (syntax) 2. validate (semantics) 3. execute 1. resolve fields 2. combine results 4. return result or errors new concept Field Resolver + Data Fetcher possibly multiple operations per request
  • 54. GraphQL Transport • Not prescribed • Most often HTTP on /graphql • POST or GET • Hard to cache • HTTP 200 with inline errors • Monitoring / Tracing by middleware
  • 55. GraphQL Auth • In GraphQL server • In Middleware before • In Field resolver • Use of directives @allowed(roles: [Admin])
  • 56. SQL NOSQL Static REST computed GraphQL Server Mobile Apps SPA (React, Ang, Vue) API Consumers End Users Any Language / Platform Middle ware Cache Aggregator Cache Aggregator Cache Aggregator
  • 58. GraphQL Development 1. Schema First – Agree on first iteration of schema 2. Register Schema 3. Implement Type Resolver 4. Fetch Data (static, db, api) 5. Implement Client App view with GraphQL client library 6. Iterate
  • 59. Uses
  • 60. GraphQL Uses Larger Companies • Consolidate sprawling APIs • API domain language • API Facades (Schema stitching) • Wrap data sources & APIs • Automatic API documentation • API monitoring • API evolution Anyone (esp. Startups) • Webapp development • Mobile app development • Quick Prototyping • GraphQL as a service
  • 61. DDD
  • 62. GraphQL and Domain Driven Design
  • 63. Users
  • 64.
  • 66. Introspection { __type(name:"Talk") { name fields { name description }}} • in every backend • queryable via graphql • for validation • type completion • visualization • fetching Schema SDLhttps://github.com/graphql-cli/graphql-cli
  • 67. Documentation # Conference Sessions type Talk { # id, e.g. Mi 3.2 id: ID! title: String! abstract: String # multiple speakers speaker: [Person!]! } • auto-generated from schema • comments as docs • browseable in client • helpful for type completion
  • 70. Tools
  • 71. GraphQL DBaaS – Graph.Cool • playground • backed by database • automatic mutation & query generation • automatic field parameters • auth • serverless functions • resolvers • graph.cool / neo4j-graphql
  • 74. GraphQL Client Libraries •apollo (js, android, ios) •graphql.js •relay-modern •...
  • 75. GraphQL DB-API / DBaaS • Prisma / GraphCool • Join-Monster • PostGraphQL / PostGraphile • Neo4j-GraphQL
  • 77. GraphQL Server Libraries (graphql-*) • JavaScript • Java • Scala (Sangria) • Ruby • Python (Graphene) • Go • .Net • PHP • ...
  • 78. GraphQL Community • GraphQL Summit • 2016,2017,2018 • GraphQL-Europe • 2016, 2017 • GraphQL Slack • 4500 users • Meetups • 65 groups • 23000 members
  • 79. 3Things I like about
  • 80. Contract for a common vocabulary
  • 83. REST
  • 84. RESTful API • several resources, reachable via URI • links between resources • HTTP as protocol • different representations / media-types, .e.g JSON
  • 85. Philosophy & Guidelines REST is software design on the scale of decades: every detail is intended to promote software longevity and independent evolution. Many of the constraints are directly opposed to short-term efficiency. - Roy Fielding http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
  • 86. Philosophy & Guidelines I think most people just make the mistake that it should be simple to design simple things. In reality, the effort required to design something is inversely proportional to the simplicity of the result. As architectural styles go, REST is very simple. - Roy Fielding http://roy.gbiv.com/untangled/2008/rest-apis-must-be-hypertext-driven
  • 87. New API Description Languages & Tools • Not much tooling in first 5 years • Web Service Description Language (WSDL) • Web Application Description Language (WADL) • Restful Service Description Language (RSDL) • HATEOAS – Hypermedia As The Engine Of Application State • Swagger • RESTful API Modeling Language (RAML)
  • 89. GraphQL REST free operation names for queries & mutations HTTP Verbs strong type safety none operations are fields in schema Resources at URIs model changes require schema + query changes no API change through model change addtive, deprecation, monitoring versioning, tagged resources allows introspection communicates links to operations depending on transport, minimally uses web infrastructure strong tooling some tooling, depending on API tool
  • 90. REST Benefits • Well understood and known • HTTP Protocol incl. Verbs • Web Standards • Web Infrastructure (Caching, Auth) • Isolated Resources • Dynamic links / data in REST API change client behavior
  • 91. REST Issues • Most RESTful API are just HTTP APIs • Effort for complex queries (n+1, latency) • Overfetching, Underfetching • Versioning
  • 92. GraphQL Benefits • Type Safety • Schema = Contract • No overfetching, only resolve requested fields • Single Request • Combining Queries / Reusing existing Results • Good set of libraries • Explicit Specification + Reference Implementation • Active Community / Drivers / Tools
  • 93. GraphQL Issues • Still New / Adoption • Filtering • Aggregation • Auth • Move aggregation to server • Caching in Server & Client • Larger Request Sizes • Can't change hierarchy structure
  • 94. Ressources 1. graphql.org 2. howtographql.com 3. github.com/chentsulin/awesome-graphql 4. graph.cool 5. github.com/graphql-java 6. Artikel MH JS 4/2017 (github.com/jexp/javaspektrum-graphql- demo)

Notas do Editor

  1. If you remember only one thing from today ...
  2. design principles: Hierarchical: Most product development today involves the creation and manipulation of view hierarchies. To achieve congruence with the structure of these applications, a GraphQL query itself is structured hierarchically. The query is shaped just like the data it returns. It is a natural way for clients to describe data requirements. Product‐centric: GraphQL is unapologetically driven by the requirements of views and the front‐end engineers that write them. GraphQL starts with their way of thinking and requirements and build the language and runtime necessary to enable that. Strong‐typing: Every GraphQL server defines an application‐specific type system. Queries are executed within the context of that type system. Given a query, tools can ensure that the query is both syntactically correct and valid within the GraphQL type system before execution, i.e. at development time, and the server can make certain guarantees about the shape and nature of the response. Client‐specified queries: Through its type system, a GraphQL server publishes the capabilities that its clients are allowed to consume. It is the client that is responsible for specifying exactly how it will consume those published capabilities. These queries are specified at field‐level granularity. In the majority of client‐server applications written without GraphQL, the server determines the data returned in its various scripted endpoints. A GraphQL query, on the other hand, returns exactly what a client asks for and no more. Introspective: GraphQL is introspective. A GraphQL server’s type system must be queryable by the GraphQL language itself, as will be described in this specification. GraphQL introspection serves as a powerful platform for building common tools and client software libraries.
  3. Strong Typing  defines an application‐specific type system queries within its context syntactically correct & valid within context, feedback during dev. time Client‐specified queries publishes the capabilities that its clients are allowed to consume client responsible for specifying exactly what it wants to retrieve (field level) Hierarchical create and manipulate view hierarchies query shaped in same way as result data Product Centric driven by the requirements of views and the front‐end engineers build the language and runtime necessary to enable their way of thinking Introspective type system must be queryable using graphql itself powerful platform for building common tools and client software libraries
  4. Strong Typing  defines an application‐specific type system queries within its context syntactically correct & valid within context, feedback during dev. time Client‐specified queries publishes the capabilities that its clients are allowed to consume client responsible for specifying exactly what it wants to retrieve (field level) Hierarchical create and manipulate view hierarchies query shaped in same way as result data Product Centric driven by the requirements of views and the front‐end engineers build the language and runtime necessary to enable their way of thinking Introspective type system must be queryable using graphql itself powerful platform for building common tools and client software libraries
  5. design principles: Hierarchical: Most product development today involves the creation and manipulation of view hierarchies. To achieve congruence with the structure of these applications, a GraphQL query itself is structured hierarchically. The query is shaped just like the data it returns. It is a natural way for clients to describe data requirements. Product‐centric: GraphQL is unapologetically driven by the requirements of views and the front‐end engineers that write them. GraphQL starts with their way of thinking and requirements and build the language and runtime necessary to enable that. Strong‐typing: Every GraphQL server defines an application‐specific type system. Queries are executed within the context of that type system. Given a query, tools can ensure that the query is both syntactically correct and valid within the GraphQL type system before execution, i.e. at development time, and the server can make certain guarantees about the shape and nature of the response. Client‐specified queries: Through its type system, a GraphQL server publishes the capabilities that its clients are allowed to consume. It is the client that is responsible for specifying exactly how it will consume those published capabilities. These queries are specified at field‐level granularity. In the majority of client‐server applications written without GraphQL, the server determines the data returned in its various scripted endpoints. A GraphQL query, on the other hand, returns exactly what a client asks for and no more. Introspective: GraphQL is introspective. A GraphQL server’s type system must be queryable by the GraphQL language itself, as will be described in this specification. GraphQL introspection serves as a powerful platform for building common tools and client software libraries.
  6. Represents named entrypoint Declared in Schema as Query Object Field that takes named parameter Returns Object Type or Scalar Implementation in GraphQL Server Extensible via Directives
  7. Represents named Update Operation Declared in Schema as Mutation Field that takes parameters Returns Object Type or Scalar Implementation in GraphQL Server
  8. Represents named Update Operation Declared in Schema as Mutation Field that takes parameters Returns Object Type or Scalar Implementation in GraphQL Server
  9. Represents named Update Operation Declared in Schema as Mutation Field that takes parameters Returns Object Type or Scalar Implementation in GraphQL Server
  10. Represents named Update Operation Declared in Schema as Mutation Field that takes parameters Returns Object Type or Scalar Implementation in GraphQL Server
  11. Represents named Update Operation Declared in Schema as Mutation Field that takes parameters Returns Object Type or Scalar Implementation in GraphQL Server
  12. like Java Annotation In Type Schema or Query on Types, Fields, Parameters e.g. @isUnique, @isDeprecated, @local custom directives can have parameters, and directives
  13. field resolver
  14. language specfication typesafe schema validations of query & schema introspection capabilities built in documentation schema with separate queries and mutations subscriptions typesafe, named parameters on every field, default params arbitrary nesting of queries mutations can return data directives as built-in extension mechanism support offline mode add + deprecate fields & types proper type system – object types, input types, enums, union, scalars, basic types nullability type references monitoring & tracking per field virtual schema stitching Aliases (named) fragments multiple queries, mutations per request aliases