Expand my Community achievements bar.

Adobe Developers Live, May 2023 | Understand GraphQL API performance options and query optimizations

Avatar

Administrator

Adobe Developer Live October 2023

Session Details

Key value: This session enables you to create performant GraphQL queries, based on the best practices we recently published. Content: Headless content delivery based on GraphQL can be fast, but might also cause performance bottlenecks in some cases. It all depends on how you develop your GraphQL queries. In this session, you will learn tips and tricks and best practices of the latest AEM GraphQL features, and how to exploit those to fine-tune your GraphQL queries for a performant delivery of your content!

Session Recording

Session Schedule

23rd May, 2023 | 09:45-10:30 PST OR 17:45-18:30 UTC OR 18:45-19:30 CET

Speaker(s)

Jabran Asghar, Sr. Software Engineer, Adobe

Moderator(s)

Adobe

Service(s)

Headless

Full Schedule

Check Here

Q&A

Please use this thread to ask the question related to this Session.

Don't forget to register yourself for this session using the registration link shared above. 



Kautuk Sahni
8 Replies

Avatar

Level 2

Hello everyone.

  1. I'm using AEM 6.5 on-premise and wondering why GraphQL persisted queries are not cached by default on the Dispatcher?
    In order to cache them, I need to add a .json extension to the request, because by default the request without extension is not cached.
  2. In the video, the procedure to update content fragments for performance optimization was mentioned https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap... Is there something similar to do for AEM 6.5?

Thanks!

Avatar

Administrator

@Nikita_Mitroshin I have asked the speaker of this session to review your post. 



Kautuk Sahni

Avatar

Employee

@Nikita_Mitroshin 

1. Dispatcher does not cache if an extension [0] is missing. Therefore, you can

  1.a. Either, use an extension (e.g. .json) with the persisted query name when creating the persisted query

  1.b. Or, add the following rewrite rule, to let dispatcher add an extension by default, so that the query results can be cached

 

RewriteCond %{REQUEST_URI} ^/graphql/execute.json
RewriteRule ^/(.*)$ /$1;.json [PT,L]​

 

2. Yes, there is a procedure for updating your Content Fragments for optimized GraphQL Filtering [1] in AEM 6.5.

 

[0] https://experienceleague.adobe.com/docs/experience-manager-dispatcher/using/troubleshooting/dispatch...

[1] https://experienceleague.adobe.com/docs/experience-manager-65/developing/headless/delivery-api/graph...

Avatar

Community Advisor

Hello Folks,

 

I have one question regarding above session, Jabran mentioned that Sorting & pagination feature is coming in AEM Sp17 on AMS and I can see this feature is already available in Prerelease mode in AEMaaCS. I am wondering, when can this be available in full normal release of AEMaaCS instance. Can you please help provide approx. date or release version for the same?

Avatar

Employee

@iamnjain 

The feature is already available in AEMaaCS with release 11382+.

Mentioning this as Prerelease is a documentation error, we shall update it. Thanks for catching that.

Avatar

Level 1

Hi @kautuk_sahni,

 

Can you help me with more insight plus any documentation to understand the hybrid filtering. https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/question-about-hybrid-filt...

 

Thanks!

Avatar

Employee

Hi @Karthikyarru,

In simple words, GraphQL hybrid filtering in my talk [0] referred to:

  1. Filtering as much as possible at the JCR level
  2. Filtering the rest (if necessary) in memory

At present, to observe what JCR query and filtering was executed at the JCR level, you can simply use "Popular Queries" tab on AEM query performance [1] UI. For example:

  1. Reset statistics at [1]
  2. Execute your GraphQL query (e.g. a persisted query or using AEM GraphiQL)
  3. Refresh [1] and see popular queries tab, you should find the JCR query corresponding to your GraphQL query along with filters that were passed to the JCR. If you don't find a particular filter in the JCR query (corresponding to your GraphQL filters), then that would have been applied in memory after fetching the result set.

To get an idea what kind of filters will not be applied at the JCR level, see "filter exclusions" section at [2].

I hope this helps.


[0] https://experienceleague.adobe.com/docs/events/adobe-developers-live-recordings/2023/may2023/graphql...
[1] http://localhost:4502/libs/granite/operations/content/diagnosistools/queryPerformance.html (change host/port as necessary)
[2] https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...