We have a requirement that during the page loads we need to check whether that page is published from all the child publications or not. Based on that result, we need to add those URLs to the page.
In our current implementation, we have a list of child publications. In the page controller, we are looping through that list and checking if this page exists(using GraphQL query)or not. This approach is definitely increasing the number of calls to the API, and sometimes it is throwing 502 error -
Sdl.Tridion.Api.GraphQL.Client.Exceptions.GraphQLClientException: Failed to get http response from 'https://.tridion.sdlproducts.com/cd/api' with request: HttpRequest: Path= Method=POST ContentType=application/json ---> Sdl.Tridion.Api.Http.Client.Exceptions.HttpClientException: Failed to get http response from 'https://.tridion.sdlproducts.com/cd/api' with request: HttpRequest: Path= Method=POST ContentType=application/json ---> System.Net.WebException: The remote server returned an error: (502) Bad Gateway.
I am looking for an option where we can get the result in one shot. Any suggestion?
Note*: I am using DXA 2.2 with Sites 9.1