Now THIS is the industry standard. REST API is so last season.
GraphQL was invented within Facebook.
GraphQL has been delivering data to Facebook mobile News Feed since 2012.
Facebook released it publicly in 2015 at:
The status of community as of November 5, 2015:
- 4,376 followers of Twitter account @GraphQL
- 2,328 registered on Facebook’s GraphQL Slack channel managed by Bruno Lemos.
- 540 answers tagged on StackOverflow
- 519 members who joined Facbook’s GraphQL group
- 350 attended the first #graphqlsummit (hosted by Apollo) October 26, 2016 in San Francisco
- 4,500 videos with the name on YouTube
- 45 presentations on SlideShare
- 149 members in the “GraphQL User Group” on LinkedIn which succintly describes GraphQL thus:
“GraphQL is the new standard for data API from Facebook, superseding REST. It allows a single data graph with strongly typed schema to serve just as much data as needed from a client. GitHub is switching to GraphQL already.”
There are Google Groups for specific implementations:
It was a necessity for the world’s busiest mobile app for these advantages over REST API:
Perform an introspection query. As the GraphQL schema matures, new data types appear.
Make a single call to retrieve (rather than many REST API calls).
Response is structured using the same JSON hierarchy as the call. A shared schema language between front-end and back-end. This is hugh.
Changes can occur with less fuss (pain) than REST API. No large version migrations.
Static queries make loading predictable, and cleaner server metric insights.
Schema says which fields are being used, so caching (persisted queries) is possible.
“With GraphQL, we could simply stop writing API documentation or reading it. I think that’s the dream of every developer.” - by @arunoda
Facebook Relay vs. Apollo
Facebook also released its Relay server that responds to GraphQL queries. It’s a JS framework based on React Redux.
CAUTION: Look at the licensing statements from Facebook. You should not use works from Facebook if you might have a product that might infringe on something Facebook may do in the future, such as any social networking, including IoT.
An alternative is SPARQL used in IoT.
https://dev-blog.apollodata.com/ is based on React Redux, React Native
Apollodata.com/Optics provides metrics: execution traces, field latencies, field usage
- Query builder
- Error handling
- Conditional fetching
- Fragments group commonly used fields and reuses them.
- Optimistic UI
GraphQL is a data description language and not a programming language
TODO: Example code
OG GraphQL co-creators at Facebook:
Lee Byron (@leeb, leebyron.com)
Relay creators at Facebook:
Joe Savona (@en_JS)
Meteor Development Group / ApolloData.com / GitHub.com/apollostack
CEO Geoff Schmidt (@immir)
VP of Product Matt DeBergalis
Sashko Stubailo (@stubailo) Slidshare
Apollo Services Danielle Man (@danimman)
- Brandon Black
Brennan Saeta (@bsaeta)
Founder Andrew Ng (@AndrewYNg) on Machine Learning
- Kenton Jacobsen from Conde Nast
- Nick Nance from Credit Karma
- Mike Isman from Hudl
- Aaron Weiker from Concur
I couldn’t find a PSGallery module for referencing GitHub’s GraphQL, so I set out to create one when that’s what Karol Kaczmarek suggested I do.
DataLoader to reduce over-fetching (one record several times)
Neo4j Online Meetup - Creating a GraphQL Api with Neo4j by Mark Needham
More on API Microservices
This is one of a series:
- API Portals
- GraphQL API
- GitHub API
- GitHub GraphQL API
- API Swagger
- API Design Tools
- API Design
- API Programming
- REST API Responses
- API Management Evaluation
- API Management by Microsoft Azure
- API Management by Amazon
- PowerShell GitHub API Programming
- PowerShell API Programming
- PowerShell Desired State Configuration
- PowerShell on Mac