Skip to content

stevenwcarter/aem-model-graphql-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AEM Model GraphQL Proxy

Rockstar 2022

Author: Steven Carter

Thanks for taking the time to check out the source for the GraphQL proxy I demoed for AEM Rockstar 2022. This repository is definitely in alpha stages, and is only intended as a quick proof of concept for the ability to take the existing Sling model export format and show that it could be converted easily to GraphQL. This is not production-ready code, and it would be far better to utilize the concepts shown herein directly within AEM itself, perhaps even bypassing the need to generate the .model.json export in the first place.

To get started, ensure that you have AEM running. The code currently defaults to http://localhost:4502 within com.bounteous.service.AEMServiceImpl so you can change the endpoint there if needed.

You can run the project by running the WebServiceMain class in the test folder.

You should now be able to make graphql requests against this endpoint. If you've previously configured the wknd-spa-react sample, then the following request should work for you:

curl -i -XPOST -H'Content-Type: application/json' -d'{"operationName":"PageQuery","variables":{"path":"/content/wknd-spa-react/us/en/home/browser"},"query":"query PageQuery($path: String) { pageModel(path: $path) { cssClassNames path templateName childrenPaths title type itemsOrder items { key component { ... on AEMResponsiveGrid { items { key component { ... on AEMHeader { type items { active children { active lastModified level path title url } lastModified level path title url}}}}}}}}}"}' 'http://localhost:9999/graphql'

I recommend using the graphiql browser extension for experimenting with queries.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages