DRUPAL    GRAPHQL

Philipp Melab (@pmelab)
Sebastian Siemssen (@thefubhy)

http://graphql.org/swapi-graphql

Application Layer
Data Querying
Language

Schema

Type System

Arbitrary Code

Anatomy of a GraphQL Server

GraphQL

Your application code

Database

Internal APIs

Remote APIs

Schema definition

?!

Evolving the server–client relationship

Server publishes possibilities

Client specifies concrete data requirements

https://facebook.github.io/graphql

https://github.com/graphql/graphql-js

https://github.com/fubhy/graphql-drupal

GraphQL & Drupal

Database API

Entity API

Routing

Interface Translation

Contexts

Views

Field Formatters

Rules

Chopping off the head

"Decoupled"

Move the line in our favour

  • Resolve Drupal paths
  • Retrieve Contexts
  • Rendered fields by default, enhance if necessary
    • Entity references
    • Images
    • Raw data
  • Create fields from views
  • Create mutations from actions/rules

Database API

Entity API

Routing

Frontend Translation

Contexts

Views

Field Formatters

Rules

Re-attaching the head

DEMO TIME

QUESTIONS

The wonders of GraphQL and Drupal

By Sebastian Siemssen

The wonders of GraphQL and Drupal

  • 1,588