GraphQL is becoming a trend-setting tool to query the response now. There are some cons to the traditional way of using API calls.
The difference between GraphQL and API:
Usually, an API response dumps all the information passed from the third party back-end. But when we use GraphQL we can just query only the required relevant there by the data transfer load is less.
AEM as back-end with GraphQL:
Here AEM Content will be exposed as an API using content/ assets API and GraphQL queries the response and send the relevant response to any third party application like REACT or Angular.
Sample use case:
In my test scenario, I had created a content fragment in AEM and exposed over an http API. I have a GraphQL layer deployed on a stand-alone Node JS and this GraphQL queries the Content Fragment API for relevant information. This data then sent to the REACT application for display purposes.
AEM for content display from third party system:
In this case, GraphQL queries any third party system and sends the relevant information to AEM.
Sample use case: I have a Facebook API to retrieve a set of information from Facebook and it was then filtered through GraphQL and then send to AEM.
What Next?
I will come up with GraphQL Setup + AEM Integration with GraphQL in my upcoming tutorials. Keep watching this page for more.
Reference: https://www.aemtutorial.info/
No comments:
Post a Comment
If you have any doubts or questions, please let us know.