A query language for your API
(and how we could use it in SilverStripe)
Schema smarts are built in
Flexible backend integration
Multiple "resources" in a single call
Enables co-location of API query with view
A specification created by Facebook
Alternative to REST and SOAP
GraphQL servers in many languages (Node, PHP, etc)
Used by the new Github API, Pinterest, Shopify, ...
Interest by Drupal Core
Get exactly the data you need
Operates on types and a declarative schema
A type can be a scalar (Int) or complex (Film)
Types in PHP
Queries in PHP
How about SilverStripe 4?
- Early stage investigation!
- Create a supported core API (easier than REST)
- View performance: Load config, current user, menu items, page tree, form schemas, ... - in one request
- Shift in dev thinking: Types and model constraints vs. getCMSFields()
GraphQL & SilverStripe