Thursday, 15 November 2018

SDL Tridion Sites 9 New Feature - GraphQL

The New SDL Tridion sites 9 Content API uses GraphQL. GraphQL is a data fetching and Query Language for APIs. It was created by Facebook in 2012 and was open sourced in 2015.

Advantages of GraphQL
  1. Instead of making multiple endpoints call in REST version here in the just single endpoint we can get the data(JSON).
  2. Documentation is available online [click]
  3. Online Community support [click]
GraphQL can be used with multiple deceives, like Facebook developed this to power their mobile application.GraphQL can be used in any application, web application or mobile app many different programming languages support GraphQL [learn more].

So, let get back to the content API, when you install the content API you will see a new endpoint.
content API
Now, let run some query to get the data but first, we need to install GraphQL client tool, I have GraphiQL installed [download]

Let's run some sample queries.

Page content
Page
Component Presentation
Component Presentation 
Publication
Publication

To learn more, how to structure GraphQL queries the documentation about GraphQL query is available on SDL docs site you can refer that.[link]

Happy coding and keep sharing !!!

No comments:

Post a Comment