Adaptto2021 Playing Headlessly With GraphQL Capabilities in AEM EvgenyTugarev
Adaptto2021 Playing Headlessly With GraphQL Capabilities in AEM EvgenyTugarev
Adaptto2021 Playing Headlessly With GraphQL Capabilities in AEM EvgenyTugarev
2
Headless capabilities in AEM
3
Content Fragments & GraphQL
4
Content Fragments
▪ Content Fragment
▪ Rely on a model definition
▪ One model - multiple content fragments (1:many)
▪ Presentation-agnostic, intended for multi channel
use
▪ Strongly typed, well suited for GraphQL
5
Recap on GraphQL
6
Sling GraphQL support in AEM
7
GraphQL Endpoints & configurations
▪ Configurations
▪ Content Fragment managed as assets
▪ Endpoints
POST POST
▪ Divide, conquer /cq:graphql/global/endpoint.json /cq:graphql/adaptto/endpoint.json
/conf/global /conf/adaptto
8
Designing and testing the API
9
Content Fragment Model Editor, what’s new?
▪ Types
▪ Fragment Reference,
▪ JSON
▪ Child Fragment Reference
▪ Attributes
▪ Unique, translatable
10
Fragment Reference
11
Json
▪ A scalar type
▪ No filtering
▪ Included in query output as is a: {
▪ Validated info : {
“prop1” : “value1”
“prop2” : [”a”, “b”, “c”]
Model A }
}
info : Json
12
From models to GraphQL schema
▪ Generated queries
▪ ByPath(…), List(…)
▪ Generated types
▪ ModelResult, ModelResults, ModelFilter
13
Content Fragment Editor, what’s new?
▪ Improved UI
▪ Structure tree
▪ JSON preview
▪ Access to model
▪ Nested fragments editing
▪ Direct publishing
14
Developer workflow
15
Persisted Queries & Performance
16
GraphQL Security
17
Consuming output data
18
Headless API & WKND Project
19
A conference schedule application
▪ Development Plan
▪ Use react command line tools to generate application skeleton
▪ Add dependencies, create a Schedule component
▪ Add styling and Presentation component (pre-built)
▪ Improvement Ideas
▪ Add authors list
▪ Use persisted queries! ☺
▪ Application Link
▪ https://github.com/etugarev/adapt-to-schedule
20
What’s next?
21
Resources
▪ https://graphql.org/
▪ https://one-inside.com/aem-headless-cms/
▪ https://www.veriday.com/blog/headless-cms-pros-cons-decoupling/
▪ https://adapt.to/2020/en/schedule/graphql-in-apache-sling-but-isnt-it-
the-opposite-of-rest.html
▪ https://sling.apache.org/documentation/bundles/metrics.html
▪ https://www.udemy.com/course/react-the-complete-guide-incl-redux/
▪ https://www.youtube.com/watch?v=zepOmSsZUjE
▪ https://experienceleague.adobe.com/docs/experience-manager-cloud-
service/headless-journey/developer/overview.html
22
Thank you! Q/A
23