Not to Return default Master variation in Graphql response | Community
Skip to main content
ravir73578276
Level 3
April 10, 2023

Not to Return default Master variation in Graphql response

  • April 10, 2023
  • 1 reply
  • 793 views

I have a content fragment having set of variations. I have written a graphql query to get the content fragment data for a given variation. The problem is graphql returns the master variation data as default if the specified variation is not available.

Ideally , I should be expecting empty response if the given variation doesn't exists.

Is there any possibility  to avoid getting master variation data in response as default ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Saravanan_Dharmaraj
Community Advisor
Community Advisor
April 10, 2023
ravir73578276
Level 3
April 23, 2023

Hy @saravanan_dharmaraj , The above mentioned post talks about using the list query in which  we can apply filters and we only get those result sets. I am talking about using content fragment by path query. where I will be passing the path of the content fragment and the required variation. The problem is if the particular variation doesn't exist Adobe documentation says we will get master variation as default fallback which can be misleading.

I want to avoid getting fallback master variation response in path based query.

 

query {
  article(variation:"spanish", _path:"/path/to/article/contentfragment") {
    item {
      _path,
      title,
      
    }
  }
}