I am trying to fetch a single Translated page by slug in wordpress WPML Graphql, after sur fing through the web and found this link https://wpml.org/forums/topic/unable-to-query-a-post-by-slug-with-graphql-endpoint/, i saw that it is not supported yet to fetch secondary languages data by slug except through this workaround below. After adding the code, i could fetch the single data but i had to manually change the slug of the duplicated post because the slug remains the same as the default original or source post.
Is there a better to solve this problem or How can i make the slugs different from the original content . I use WPML, WPGRAPHQL
add_filter('request', function($vars){
if ( is_graphql_http_request() && !empty($vars['name']) ) {
$vars['suppress_filters'] = true;
}
return $vars;
});