SlideShare a Scribd company logo
1 of 66
Download to read offline
Roy Derks
@gethackteam
GraphQL Is No Excuse
To Stop Writing Docs
@gethackteam
What is documentation?
@gethackteam
@gethackteam
A little bit about
myself
fi
rst…
Roy Derks
@gethackteam
Hey! I'm Roy
an entrepreneur and software
engineer, author and public speaker
from The Netherlands.
+ more
@gethackteam
@gethackteam
What is documentation?
@gethackteam
Documentation is any
communicable material that is
used to describe, explain or
instruct regarding some attributes
of an object, system or procedure,
such as its parts, assembly,
installation, maintenance and use.
- the internet
@gethackteam
Documentation is communicable
material (1/2)
@gethackteam
@gethackteam
@gethackteam
Or for GraphQL
@gethackteam
@gethackteam
Let’s give it up for the
GraphiQL team 👏👏
@gethackteam
Documentation could be both
static and dynamic
@gethackteam
Documentation could be both
static and dynamic
@gethackteam
Documentation could be both
static and dynamic
- API Playgrounds
- Code examples
- GraphiQL
@gethackteam
Documentation is used to describe,
explain or instruct (2/2)
@gethackteam
1. describe 2. explain
3. instruct
@gethackteam
1. describe 2. explain
3. instruct
@gethackteam
describe
List of attributes:
API reference
SDK reference
…
@gethackteam
1. describe 2. explain
3. instruct
@gethackteam
explain
Explain concepts,
procedures or
@gethackteam
1. describe 2. explain
3. instruct
@gethackteam
instruct
Instruct on
installation, usage
or maintenance
@gethackteam
How are GraphQL APIs usually
documented?
@gethackteam
First, a hard question
@gethackteam
Is GraphQL really
self-documenting?
introspection
type Customer {
address: Address
email: String
id: Int
name: String
}
type Query {
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
schema
curl -X POST -H "Content-Type: application/json"
-d '{"query": "{ __schema { queryType { name } }"}'
https://my.graphql.server/graphql
@gethackteam
@gethackteam
introspection
type Customer {
address: Address
email: String
id: Int
name: String
}
type Query {
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
schema
curl -X POST -H "Content-Type: application/json"
-d '{"query": "{ __schema { queryType { name } }"}'
https://my.graphql.server/graphql
GraphiQL
* OPTIONAL
@gethackteam
Is GraphQL really
self-documenting?
@gethackteam
Only up to a small amount
@gethackteam
The power is in the schema and
introspection
@gethackteam
introspection
type Customer {
address: Address
email: String
id: Int
name: String
}
type Query {
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
schema
curl -X POST -H "Content-Type: application/json"
-d '{"query": "{ __schema { queryType { name } }"}'
https://my.graphql.server/graphql
@gethackteam
Introspection exposes your
GraphQL schema
@gethackteam
introspection
type Customer {
address: Address
email: String
id: Int
name: String
}
type Query {
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
schema
curl -X POST -H "Content-Type: application/json"
-d '{"query": "{ __schema { queryType { name } }"}'
https://my.graphql.server/graphql
GraphiQL
@gethackteam
And can be used by tools
like GraphiQL
@gethackteam
introspection
type Customer {
address: Address
email: String
id: Int
name: String
}
type Query {
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
schema
curl -X POST -H "Content-Type: application/json"
-d '{"query": "{ __schema { queryType { name } }"}'
https://my.graphql.server/graphql
GraphiQL
@gethackteam
There are similar tools
like GraphiQL
@gethackteam
GraphQL Playground, Apollo Studio,
GraphQL Editor, …
@gethackteam
But are these tools enough?
Documentation is any
communicable material that is
used to describe, explain or
instruct regarding some attributes
of an object, system or procedure,
such as its parts, assembly,
installation, maintenance and use.
- the internet
@gethackteam
Documentation is any
communicable material that is
used to describe, explain or
instruct regarding some attributes
of an object, system or procedure,
such as its parts, assembly,
installation, maintenance and use.
- the internet
@gethackteam
@gethackteam
GraphiQL
Describe ✅
Explain
Instruct
@gethackteam
GraphiQL
Describe ✅
Explain
Instruct ✅
@gethackteam
Describe ✅
Explain?
Instruct ✅
@gethackteam
Description
OR
Explanation?
@gethackteam
"""
Multiline description of the User type
"""
type Customer {
address: Address
email: String
id: Int # Unique identifier of the customer in a single line
name: String
}
type Query {
"""
Will return a list of customers
More info in our documentation
"""
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
Schema annotations
@gethackteam
"""
Multiline description of the User type
"""
type Customer {
address: Address
email: String
id: Int # Unique identifier of the customer in a single line
name: String
}
type Query {
"""
Will return a list of customers
More info in our documentation
"""
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
Schema annotations
@gethackteam
GraphiQL (and others) lack in-depth
explain features
@gethackteam
What are we missing?
- Installation
- Authentication
- Troubleshoot
- …
@gethackteam
Earlier we learned:
Documentation could be both
static and dynamic
@gethackteam
GraphiQL is mostly dynamic, but
lacks space for explanations
@gethackteam
Space we need for text, graphics
and videos
@gethackteam
To explain how the GraphQL API
works in-depth
@gethackteam
And we can use introspect
to bootstrap it
@gethackteam
introspection
type Customer {
address: Address
email: String
id: Int
name: String
}
type Query {
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
schema
curl -X POST -H "Content-Type: application/json"
-d '{"query": "{ __schema { queryType { name } }"}'
https://my.graphql.server/graphql
@gethackteam
introspection
type Customer {
address: Address
email: String
id: Int
name: String
}
type Query {
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
schema
curl -X POST -H "Content-Type: application/json"
-d '{"query": "{ __schema { queryType { name } }"}'
https://my.graphql.server/graphql
GraphiQL
@gethackteam
introspection
type Customer {
address: Address
email: String
id: Int
name: String
}
type Query {
getCustomerList: [Customer]
getCustomerById(id: ID!): Customer
}
schema
curl -X POST -H "Content-Type: application/json"
-d '{"query": "{ __schema { queryType { name } }"}'
https://my.graphql.server/graphql
GraphiQL
Static docs
@gethackteam
There are plenty of static
documentation generators
Magidoc SpectaQL
@gethackteam
DociQL
@gethackteam
They let you extend the introspected
docs with text, markdown, and JS
@gethackteam
So we can explain:
- Installation
- Authentication
- Troubleshoot
- …
@gethackteam
GraphiQL Static docs
GraphQL Documentation
@gethackteam
GraphiQL Static docs
GraphQL Documentation
Describe ✅
Explain
Instruct ✅
Describe ✅
Explain ✅
Instruct
@gethackteam
GraphiQL Static docs
GraphQL Documentation
❤ 🚀
Roy Derks
@gethackteam
Thank you!
Let’s stay in touch
stepzen.com
hackteam.io

More Related Content

Similar to GraphQL Isn't An Excuse To Stop Writing Docs

Similar to GraphQL Isn't An Excuse To Stop Writing Docs (20)

MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScriptMongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
MongoDB World 2019: Building a GraphQL API with MongoDB, Prisma, & TypeScript
 
Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...
Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...
Ten Tips And Tricks for Improving Your GraphQL API with AWS AppSync (MOB401) ...
 
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
 
Spiffy Applications With JavaScript
Spiffy Applications With JavaScriptSpiffy Applications With JavaScript
Spiffy Applications With JavaScript
 
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
 
Building Real-Time Serverless Backends with GraphQL | AWS Floor28
Building Real-Time Serverless Backends with GraphQL | AWS Floor28Building Real-Time Serverless Backends with GraphQL | AWS Floor28
Building Real-Time Serverless Backends with GraphQL | AWS Floor28
 
[DevCrowd] GraphQL - gdy API RESTowe to za mało
[DevCrowd] GraphQL - gdy API RESTowe to za mało[DevCrowd] GraphQL - gdy API RESTowe to za mało
[DevCrowd] GraphQL - gdy API RESTowe to za mało
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
Overview of GraphQL & Clients
Overview of GraphQL & ClientsOverview of GraphQL & Clients
Overview of GraphQL & Clients
 
GraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learnedGraphQL - when REST API is to less - lessons learned
GraphQL - when REST API is to less - lessons learned
 
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
GraphQL - A query language to empower your API consumers (NDC Sydney 2017)
 
AppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learntAppSync in real world - pitfalls, unexpected benefits & lessons learnt
AppSync in real world - pitfalls, unexpected benefits & lessons learnt
 
Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup Pentest Application With GraphQL | Null Bangalore Meetup
Pentest Application With GraphQL | Null Bangalore Meetup
 
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
Danilo Poccia - Real-Time Serverless Backends with GraphQL - Codemotion Berli...
 
Let's start GraphQL: structure, behavior, and architecture
Let's start GraphQL: structure, behavior, and architectureLet's start GraphQL: structure, behavior, and architecture
Let's start GraphQL: structure, behavior, and architecture
 
Web Applications of the Future with TypeScript and GraphQL
Web Applications of the Future with TypeScript and GraphQLWeb Applications of the Future with TypeScript and GraphQL
Web Applications of the Future with TypeScript and GraphQL
 
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) ExtensionSimplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
Simplify Access to Data from Pivotal GemFire Using the GraphQL (G2QL) Extension
 
Building Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQLBuilding Real-Time Serverless Backends with GraphQL
Building Real-Time Serverless Backends with GraphQL
 
REST API に疲れたあなたへ贈る GraphQL 入門
REST API に疲れたあなたへ贈る GraphQL 入門REST API に疲れたあなたへ贈る GraphQL 入門
REST API に疲れたあなたへ贈る GraphQL 入門
 

More from Pronovix

Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations
Inclusive, Accessible Tech: Bias-Free Language in Code and ConfigurationsInclusive, Accessible Tech: Bias-Free Language in Code and Configurations
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations
Pronovix
 
Creating API documentation for international communities
Creating API documentation for international communitiesCreating API documentation for international communities
Creating API documentation for international communities
Pronovix
 
Docs-as-Code: Evolving the API Documentation Experience
Docs-as-Code: Evolving the API Documentation ExperienceDocs-as-Code: Evolving the API Documentation Experience
Docs-as-Code: Evolving the API Documentation Experience
Pronovix
 

More from Pronovix (20)

By the time they're reading the docs, it's already too late
By the time they're reading the docs, it's already too lateBy the time they're reading the docs, it's already too late
By the time they're reading the docs, it's already too late
 
Optimizing Dev Portals with Analytics and Feedback
Optimizing Dev Portals with Analytics and FeedbackOptimizing Dev Portals with Analytics and Feedback
Optimizing Dev Portals with Analytics and Feedback
 
Success metrics when launching your first developer portal
Success metrics when launching your first developer portalSuccess metrics when launching your first developer portal
Success metrics when launching your first developer portal
 
Documentation, APIs & AI
Documentation, APIs & AIDocumentation, APIs & AI
Documentation, APIs & AI
 
Making sense of analytics for documentation pages
Making sense of analytics for documentation pagesMaking sense of analytics for documentation pages
Making sense of analytics for documentation pages
 
Feedback cycles and their role in improving overall developer experiences
Feedback cycles and their role in improving overall developer experiencesFeedback cycles and their role in improving overall developer experiences
Feedback cycles and their role in improving overall developer experiences
 
API Documentation For Web3
API Documentation For Web3API Documentation For Web3
API Documentation For Web3
 
Why your API doesn’t solve my problem: A use case-driven API design
Why your API doesn’t solve my problem: A use case-driven API designWhy your API doesn’t solve my problem: A use case-driven API design
Why your API doesn’t solve my problem: A use case-driven API design
 
unREST among the docs
unREST among the docsunREST among the docs
unREST among the docs
 
Developing a best-in-class deprecation policy for your APIs
Developing a best-in-class deprecation policy for your APIsDeveloping a best-in-class deprecation policy for your APIs
Developing a best-in-class deprecation policy for your APIs
 
Annotate, Automate & Educate: Driving generated OpenAPI docs to benefit everyone
Annotate, Automate & Educate: Driving generated OpenAPI docs to benefit everyoneAnnotate, Automate & Educate: Driving generated OpenAPI docs to benefit everyone
Annotate, Automate & Educate: Driving generated OpenAPI docs to benefit everyone
 
What do developers do when it comes to understanding and using APIs?
What do developers do when it comes to understanding and using APIs?What do developers do when it comes to understanding and using APIs?
What do developers do when it comes to understanding and using APIs?
 
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations
Inclusive, Accessible Tech: Bias-Free Language in Code and ConfigurationsInclusive, Accessible Tech: Bias-Free Language in Code and Configurations
Inclusive, Accessible Tech: Bias-Free Language in Code and Configurations
 
Creating API documentation for international communities
Creating API documentation for international communitiesCreating API documentation for international communities
Creating API documentation for international communities
 
One Developer Portal to Document Them All
One Developer Portal to Document Them AllOne Developer Portal to Document Them All
One Developer Portal to Document Them All
 
Docs-as-Code: Evolving the API Documentation Experience
Docs-as-Code: Evolving the API Documentation ExperienceDocs-as-Code: Evolving the API Documentation Experience
Docs-as-Code: Evolving the API Documentation Experience
 
Developer journey - make it easy for devs to love your product
Developer journey - make it easy for devs to love your productDeveloper journey - make it easy for devs to love your product
Developer journey - make it easy for devs to love your product
 
Complexity is not complicatedness
Complexity is not complicatednessComplexity is not complicatedness
Complexity is not complicatedness
 
How cognitive biases and ranking can foster an ineffective architecture and d...
How cognitive biases and ranking can foster an ineffective architecture and d...How cognitive biases and ranking can foster an ineffective architecture and d...
How cognitive biases and ranking can foster an ineffective architecture and d...
 
APIs: Semi-permeable, osmotic interfaces
APIs: Semi-permeable, osmotic interfacesAPIs: Semi-permeable, osmotic interfaces
APIs: Semi-permeable, osmotic interfaces
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

GraphQL Isn't An Excuse To Stop Writing Docs